Skip to content

Commit

Permalink
Merge branch 'feature/custom-commands' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswayoub committed Jan 9, 2015
2 parents 019ae81 + 0db308f commit e179aa5
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 14 deletions.
1 change: 1 addition & 0 deletions Vagrant Manager/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ - (void)runTerminalCommand:(NSString*)command {
NSString *terminalName = [[NSUserDefaults standardUserDefaults] valueForKey:@"terminalPreference"];

command = [command stringByReplacingOccurrencesOfString:@"\\" withString:@"\\\\"];
command = [command stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""];

NSString *s;
if ([terminalName isEqualToString:@"iTerm"]) {
Expand Down
1 change: 1 addition & 0 deletions Vagrant Manager/ManageCustomCommandsWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ - (void)addCommandButtonClicked:(id)sender {
CustomCommand *customCommand = [[CustomCommand alloc] init];
customCommand.displayName = @"New Command";

[_commands addObject:customCommand];
[self saveCustomCommands];

[self.commandsTableView reloadData];
Expand Down
25 changes: 17 additions & 8 deletions Vagrant Manager/ManageCustomCommandsWindow.xib
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@
<window title="Manage Custom Commands" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" animationBehavior="default" id="F0z-JX-Cv5">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="196" y="240" width="564" height="296"/>
<rect key="contentRect" x="196" y="240" width="564" height="314"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1177"/>
<view key="contentView" id="se5-gp-TjO">
<rect key="frame" x="0.0" y="0.0" width="564" height="296"/>
<rect key="frame" x="0.0" y="-5" width="564" height="314"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<scrollView autohidesScrollers="YES" horizontalLineScroll="26" horizontalPageScroll="10" verticalLineScroll="26" verticalPageScroll="10" usesPredominantAxisScrolling="NO" id="RD7-mn-ZUb">
<rect key="frame" x="20" y="57" width="524" height="219"/>
<rect key="frame" x="20" y="75" width="524" height="219"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<clipView key="contentView" id="sUf-qw-N0Z">
<rect key="frame" x="1" y="17" width="522" height="201"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnReordering="NO" columnSelection="YES" autosaveColumns="NO" rowHeight="24" headerView="uYJ-6z-JVf" id="PMe-9b-iJM">
<rect key="frame" x="0.0" y="0.0" width="515.5" height="26"/>
<rect key="frame" x="0.0" y="0.0" width="522" height="26"/>
<autoresizingMask key="autoresizingMask"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
Expand Down Expand Up @@ -89,7 +89,7 @@
<rect key="frame" x="1" y="203" width="522" height="15"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="NO" id="FDU-n5-fWk">
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="FDU-n5-fWk">
<autoresizingMask key="autoresizingMask"/>
</scroller>
<tableHeaderView key="headerView" id="uYJ-6z-JVf">
Expand All @@ -98,7 +98,7 @@
</tableHeaderView>
</scrollView>
<button id="HI7-Dl-8DF">
<rect key="frame" x="20" y="27" width="31" height="22"/>
<rect key="frame" x="20" y="45" width="31" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="NSAddTemplate" imagePosition="overlaps" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="ru2-y8-dA8">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
Expand All @@ -109,7 +109,7 @@
</connections>
</button>
<button id="lt5-9Q-rut">
<rect key="frame" x="50" y="27" width="31" height="22"/>
<rect key="frame" x="50" y="45" width="31" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="NSRemoveTemplate" imagePosition="only" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="kAP-Pz-kAA">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
Expand All @@ -119,12 +119,21 @@
<action selector="removeCommandButtonClicked:" target="-2" id="g8S-e6-N28"/>
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="KDy-YO-lRX">
<rect key="frame" x="18" y="20" width="427" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Note: These commands will run in your Vagrant machine over SSH with no confirmation" id="42R-ht-Rf1">
<font key="font" metaFont="system" size="10"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
</view>
<connections>
<outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
</connections>
<point key="canvasLocation" x="505" y="394"/>
<point key="canvasLocation" x="505" y="403"/>
</window>
</objects>
<resources>
Expand Down
5 changes: 3 additions & 2 deletions Vagrant Manager/MenuDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@

#import "VagrantInstance.h"
#import "VagrantMachine.h"
#import "CustomCommand.h"

@protocol MenuDelegate <NSObject>

- (void)performVagrantAction:(NSString*)action withInstance:(VagrantInstance*)instance;
- (void)performVagrantAction:(NSString*)action withMachine:(VagrantMachine*)machine;
- (void)performCustomCommand:(NSString*)action withInstance:(VagrantInstance*)instance;
- (void)performCustomCommand:(NSString*)action withMachine:(VagrantMachine*)machine;
- (void)performCustomCommand:(CustomCommand*)customCommand withInstance:(VagrantInstance*)instance;
- (void)performCustomCommand:(CustomCommand*)customCommand withMachine:(VagrantMachine*)machine;
- (void)openInstanceInFinder:(VagrantInstance*)instance;
- (void)openInstanceInTerminal:(VagrantInstance*)instance;
- (void)addBookmarkWithInstance:(VagrantInstance*)instance;
Expand Down
8 changes: 4 additions & 4 deletions Vagrant Manager/NativeMenu.m
Original file line number Diff line number Diff line change
Expand Up @@ -497,12 +497,12 @@ - (void)performAction:(NSString*)action withMachine:(VagrantMachine *)machine {
[self.delegate performVagrantAction:action withMachine:machine];
}

- (void)performCustomCommand:(NSString*)action withInstance:(VagrantInstance*)instance {
[self.delegate performCustomCommand:action withInstance:instance];
- (void)performCustomCommand:(CustomCommand*)customCommand withInstance:(VagrantInstance*)instance {
[self.delegate performCustomCommand:customCommand withInstance:instance];
}

- (void)performCustomCommand:(NSString*)action withMachine:(VagrantMachine *)machine {
[self.delegate performCustomCommand:action withMachine:machine];
- (void)performCustomCommand:(CustomCommand*)customCommand withMachine:(VagrantMachine *)machine {
[self.delegate performCustomCommand:customCommand withMachine:machine];
}

- (void)updateRunningVmCount:(NSNotification*)notification {
Expand Down

0 comments on commit e179aa5

Please sign in to comment.