Skip to content

Commit da68154

Browse files
author
Matt Turner
committed
Merge pull request #134 from thshdw/bug-fixes-v1.2.3
bug fixes
2 parents fb81ffb + fcbc83c commit da68154

File tree

5 files changed

+43
-33
lines changed

5 files changed

+43
-33
lines changed

Shuttle.xcodeproj/project.pbxproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@
204204
C149EBF015D5214600B1F558 /* Project object */ = {
205205
isa = PBXProject;
206206
attributes = {
207-
LastUpgradeCheck = 0630;
207+
LastUpgradeCheck = 0700;
208208
ORGANIZATIONNAME = fitztrev;
209209
};
210210
buildConfigurationList = C149EBF315D5214600B1F558 /* Build configuration list for PBXProject "Shuttle" */;
@@ -303,6 +303,7 @@
303303
CLANG_ENABLE_OBJC_ARC = YES;
304304
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
305305
COPY_PHASE_STRIP = NO;
306+
ENABLE_TESTABILITY = YES;
306307
GCC_C_LANGUAGE_STANDARD = gnu99;
307308
GCC_DYNAMIC_NO_PIC = NO;
308309
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
@@ -352,6 +353,7 @@
352353
GCC_PREFIX_HEADER = "Shuttle/Shuttle-Prefix.pch";
353354
INFOPLIST_FILE = "Shuttle/Shuttle-Info.plist";
354355
MACOSX_DEPLOYMENT_TARGET = 10.7;
356+
PRODUCT_BUNDLE_IDENTIFIER = "shuttle.${PRODUCT_NAME:rfc1034identifier}";
355357
PRODUCT_NAME = "$(TARGET_NAME)";
356358
WRAPPER_EXTENSION = app;
357359
};
@@ -367,6 +369,7 @@
367369
GCC_PREFIX_HEADER = "Shuttle/Shuttle-Prefix.pch";
368370
INFOPLIST_FILE = "Shuttle/Shuttle-Info.plist";
369371
MACOSX_DEPLOYMENT_TARGET = 10.7;
372+
PRODUCT_BUNDLE_IDENTIFIER = "shuttle.${PRODUCT_NAME:rfc1034identifier}";
370373
PRODUCT_NAME = "$(TARGET_NAME)";
371374
WRAPPER_EXTENSION = app;
372375
};

Shuttle/AboutWindowController.xib

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6254" systemVersion="14B25" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="8191" systemVersion="15A284" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
33
<dependencies>
44
<deployment identifier="macosx"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6254"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="8191"/>
66
</dependencies>
77
<objects>
88
<customObject id="-2" userLabel="File's Owner" customClass="AboutWindowController">
99
<connections>
1010
<outlet property="appCopyright" destination="rfT-bT-B7g" id="9uI-a1-vwK"/>
11-
<outlet property="appHomepage" destination="se5-gp-TjO" id="xBq-5t-bl5"/>
1211
<outlet property="appName" destination="APf-vF-1w0" id="N4r-kg-BHK"/>
1312
<outlet property="appVersion" destination="LTk-GB-fgJ" id="41k-wk-DtW"/>
1413
<outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
@@ -20,7 +19,7 @@
2019
<windowStyleMask key="styleMask" titled="YES" closable="YES"/>
2120
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
2221
<rect key="contentRect" x="750" y="574" width="460" height="172"/>
23-
<rect key="screenRect" x="0.0" y="0.0" width="1366" height="745"/>
22+
<rect key="screenRect" x="0.0" y="0.0" width="1280" height="777"/>
2423
<value key="minSize" type="size" width="460" height="172"/>
2524
<value key="maxSize" type="size" width="460" height="172"/>
2625
<view key="contentView" id="se5-gp-TjO">
@@ -29,10 +28,12 @@
2928
<subviews>
3029
<imageView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="6kW-hd-spe">
3130
<rect key="frame" x="0.0" y="16" width="154" height="148"/>
31+
<animations/>
3232
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" animates="YES" imageScaling="proportionallyDown" image="shuttle" id="VBv-EA-L5r"/>
3333
</imageView>
3434
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="APf-vF-1w0">
3535
<rect key="frame" x="165" y="135" width="275" height="17"/>
36+
<animations/>
3637
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Program Name and Tag Line" id="tb3-eK-HAT">
3738
<font key="font" metaFont="system"/>
3839
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -41,6 +42,7 @@
4142
</textField>
4243
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="LTk-GB-fgJ">
4344
<rect key="frame" x="165" y="110" width="277" height="17"/>
45+
<animations/>
4446
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Version" id="6fl-Xm-UPS">
4547
<font key="font" metaFont="system"/>
4648
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -49,6 +51,7 @@
4951
</textField>
5052
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="rfT-bT-B7g">
5153
<rect key="frame" x="165" y="82" width="277" height="17"/>
54+
<animations/>
5255
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Copyright" id="Cmu-CQ-3V9">
5356
<font key="font" metaFont="system"/>
5457
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -57,6 +60,7 @@
5760
</textField>
5861
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="soF-wq-5hG">
5962
<rect key="frame" x="161" y="46" width="108" height="32"/>
63+
<animations/>
6064
<buttonCell key="cell" type="push" title="Homepage" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="uUM-88-32s">
6165
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
6266
<font key="font" metaFont="system"/>
@@ -66,6 +70,7 @@
6670
</connections>
6771
</button>
6872
</subviews>
73+
<animations/>
6974
</view>
7075
<connections>
7176
<outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>

Shuttle/AppDelegate.m

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,34 +33,32 @@ - (void) awakeFromNib {
3333
[[NSFileManager defaultManager] copyItemAtPath:cgFileInResource toPath:shuttleConfigFile error:nil];
3434
}
3535
}
36-
37-
// Load the menu content
38-
// [self loadMenu];
39-
36+
4037
// Define Icons
38+
//only regular icon is needed for 10.10 and higher. OS X changes the icon for us.
4139
regularIcon = [NSImage imageNamed:@"StatusIcon"];
4240
altIcon = [NSImage imageNamed:@"StatusIconAlt"];
4341

42+
// Create the status bar item
43+
statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength];
44+
[statusItem setMenu:menu];
45+
[statusItem setImage: regularIcon];
46+
4447
// Check for AppKit Version, add support for darkmode if > 10.9
4548
BOOL oldAppKitVersion = (floor(NSAppKitVersionNumber) <= 1265);
4649

50+
// 10.10 or higher, dont load the alt image let OS X style it.
4751
if (!oldAppKitVersion)
4852
{
49-
// 10.10 or higher, add support to icon for auto detection of Regular/Dark mode
50-
[regularIcon setTemplate:YES];
51-
[altIcon setTemplate:YES];
53+
regularIcon.template = YES;
54+
}
55+
// Load the alt image for OS X < 10.10
56+
else{
57+
[statusItem setHighlightMode:YES];
58+
[statusItem setAlternateImage: altIcon];
5259
}
5360

54-
// Create the status bar item
55-
statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:25.0];
56-
57-
[statusItem setMenu:menu];
58-
[statusItem setHighlightMode:YES];
59-
[statusItem setImage: regularIcon];
60-
[statusItem setAlternateImage: altIcon];
61-
6261
launchAtLoginController = [[LaunchAtLoginController alloc] init];
63-
6462
// Needed to trigger the menuWillOpen event
6563
[menu setDelegate:self];
6664
}
@@ -357,9 +355,11 @@ - (void) buildMenu:(NSArray*)data addToMenu:(NSMenu *)m {
357355
NSString *termTitle = cfg[@"title"];
358356
//Get the value of setting inTerminal
359357
NSString *termWindow = cfg[@"inTerminal"];
358+
//Get the menu name will will use this as the title if title is null.
359+
NSString *menuName = cfg[@"name"];
360360

361361
//Place the terminal command, theme, and title into an comma delimited string
362-
NSString *menuRepObj = [NSString stringWithFormat:@"%@,%@,%@,%@", menuCmd, termTheme, termTitle, termWindow];
362+
NSString *menuRepObj = [NSString stringWithFormat:@"%@,%@,%@,%@,%@", menuCmd, termTheme, termTitle, termWindow, menuName];
363363

364364
[menuItem setTitle:cfg[@"name"]];
365365
[menuItem setRepresentedObject:menuRepObj];
@@ -384,6 +384,7 @@ - (void) openHost:(NSMenuItem *) sender {
384384
//Are commands run in a new tab (default) a new terminal window (new), or in the current tab of the last used window (current).
385385
NSString *terminalWindow;
386386

387+
387388
//if for some reason we get a representedObject with only one item...
388389
if (objectsFromJSON.count <=1) {
389390
escapedObject = [[sender representedObject] stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""];
@@ -402,7 +403,7 @@ - (void) openHost:(NSMenuItem *) sender {
402403
}
403404
//Check if terminalTitle is null
404405
if( [[objectsFromJSON objectAtIndex:2] isEqualToString:@"(null)"]){
405-
terminalTitle = @"";
406+
terminalTitle = [objectsFromJSON objectAtIndex:4];
406407
}else{
407408
terminalTitle = [objectsFromJSON objectAtIndex:2];
408409
}
@@ -422,7 +423,7 @@ - (void) openHost:(NSMenuItem *) sender {
422423
//Set Paths to iTerm Nightly AppleScripts
423424
NSString *iTerm2NightlyNewWindow = [[NSBundle mainBundle] pathForResource:@"iTerm2-nightly-new-window" ofType:@"scpt"];
424425
NSString *iTerm2NightlyCurrentWindow = [[NSBundle mainBundle] pathForResource:@"iTerm2-nightly-current-window" ofType:@"scpt"];
425-
NSString *iTerm2StableNewTabDefault = [[NSBundle mainBundle] pathForResource:@"iTerm2-nightly-new-tab-default" ofType:@"scpt"];
426+
NSString *iTerm2NightlyNewTabDefault = [[NSBundle mainBundle] pathForResource:@"iTerm2-nightly-new-tab-default" ofType:@"scpt"];
426427

427428
//Set Paths to terminalScripts
428429
NSString *terminalNewWindow = [[NSBundle mainBundle] pathForResource:@"terminal-new-window" ofType:@"scpt"];
@@ -473,7 +474,7 @@ - (void) openHost:(NSMenuItem *) sender {
473474
[self runScript:iTerm2NightlyCurrentWindow handler:handlerName parameters:passParameters];
474475
}else {
475476
//we are using the default action of shuttle, use the active window in a new Tab
476-
[self runScript:iTerm2StableNewTabDefault handler:handlerName parameters:passParameters];
477+
[self runScript:iTerm2NightlyNewTabDefault handler:handlerName parameters:passParameters];
477478
}
478479
}
479480
}
@@ -601,11 +602,12 @@ - (IBAction)configure:(id)sender {
601602
}
602603

603604
- (IBAction)showAbout:(id)sender {
604-
605-
//Call the windows controller
605+
606+
//Call the windows controller
606607
AboutWindowController *aboutWindow = [[AboutWindowController alloc] initWithWindowNibName:@"AboutWindowController"];
607608

608609
//Set the window to stay on top
610+
[aboutWindow.window makeKeyAndOrderFront:nil];
609611
[aboutWindow.window setLevel:NSFloatingWindowLevel];
610612

611613
//Show the window

Shuttle/Shuttle-Info.plist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@
99
<key>CFBundleIconFile</key>
1010
<string>shuttle</string>
1111
<key>CFBundleIdentifier</key>
12-
<string>shuttle.${PRODUCT_NAME:rfc1034identifier}</string>
12+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
1313
<key>CFBundleInfoDictionaryVersion</key>
1414
<string>6.0</string>
1515
<key>CFBundleName</key>
1616
<string>${PRODUCT_NAME}</string>
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.2.3</string>
20+
<string>1.2.4</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>1.2.3</string>
24+
<string>1.2.4</string>
2525
<key>LSApplicationCategoryType</key>
2626
<string>public.app-category.developer-tools</string>
2727
<key>LSMinimumSystemVersion</key>

Shuttle/shuttle.default.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
{
1717
"cmd": "ps aux | grep foo",
1818
"inTerminal": "new",
19-
"name": "My Dev Server",
20-
"theme": "Homebrew",
21-
"title": "Dev Server - SSH"
19+
"name": "look for process foo",
20+
"theme": "Default",
21+
"title": "grep foo"
2222
},
2323
{
2424
"Spouses Servers": [

0 commit comments

Comments
 (0)