Skip to content

Commit

Permalink
Lion changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jay committed Jul 23, 2011
1 parent ce19f43 commit 5479e76
Show file tree
Hide file tree
Showing 15 changed files with 74 additions and 90 deletions.
20 changes: 15 additions & 5 deletions Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,41 @@
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDocumentTypes</key>
<array/>
<key>CFBundleExecutable</key>
<string>&gt;cd to ...</string>
<string>cd to</string>
<key>CFBundleIconFile</key>
<string>leop_app</string>
<string>lion.icns</string>
<key>CFBundleIdentifier</key>
<string>indy.jt.cdto</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>&gt;cd to ...</string>
<string>cd to</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array/>
<key>CFBundleVersion</key>
<string>4</string>
<key>LSMinimumSystemVersion</key>
<string>10.6</string>
<key>LSUIElement</key>
<string>1</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSMinimumSystemVersion</key>
<string>10.6</string>
<key>NSServices</key>
<array/>
<key>UTExportedTypeDeclarations</key>
<array/>
<key>UTImportedTypeDeclarations</key>
<array/>
</dict>
</plist>
30 changes: 16 additions & 14 deletions cd to ....xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 42;
objectVersion = 46;
objects = {

/* Begin PBXBuildFile section */
Expand All @@ -14,6 +14,7 @@
69449AD20B8909A500A19631 /* CD2PluginProtocolV1.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 69449AD10B8909A400A19631 /* CD2PluginProtocolV1.h */; };
69449C330B892D7600A19631 /* X11_xterm.bundle in Copy Disabled Plugins */ = {isa = PBXBuildFile; fileRef = 69449C110B892D0B00A19631 /* X11_xterm.bundle */; };
69449D890B894DCB00A19631 /* iterm.bundle in Copy Disabled Plugins */ = {isa = PBXBuildFile; fileRef = 69449D880B894DBF00A19631 /* iterm.bundle */; };
6947E8C713DA6362008C982D /* lion.icns in Resources */ = {isa = PBXBuildFile; fileRef = 6947E8C613DA6362008C982D /* lion.icns */; };
69C8A98E106E818900C4DE0D /* ScriptingBridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 69C8A98D106E818900C4DE0D /* ScriptingBridge.framework */; };
69C8AA71106E8F5800C4DE0D /* Finder.app in Resources */ = {isa = PBXBuildFile; fileRef = 69C8AA70106E8F5800C4DE0D /* Finder.app */; };
69C8AA89106EE02F00C4DE0D /* Finder.app in Sources */ = {isa = PBXBuildFile; fileRef = 69C8AA70106E8F5800C4DE0D /* Finder.app */; };
Expand Down Expand Up @@ -133,10 +134,11 @@
69449AD10B8909A400A19631 /* CD2PluginProtocolV1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CD2PluginProtocolV1.h; path = plugins/CD2PluginProtocolV1.h; sourceTree = "<group>"; };
69449C090B892D0B00A19631 /* X11_xterm.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = X11_xterm.xcodeproj; path = plugins/X11_xterm/X11_xterm.xcodeproj; sourceTree = "<group>"; };
69449D830B894DBF00A19631 /* iterm.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = iterm.xcodeproj; path = plugins/iterm/iterm.xcodeproj; sourceTree = "<group>"; };
6947E8C613DA6362008C982D /* lion.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = lion.icns; sourceTree = "<group>"; };
69C8A98D106E818900C4DE0D /* ScriptingBridge.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ScriptingBridge.framework; path = /System/Library/Frameworks/ScriptingBridge.framework; sourceTree = "<absolute>"; };
69C8AA70106E8F5800C4DE0D /* Finder.app */ = {isa = PBXFileReference; lastKnownFileType = wrapper.application; name = Finder.app; path = /System/Library/CoreServices/Finder.app; sourceTree = "<absolute>"; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
8D1107320486CEB800E47090 /* >cd to ....app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ">cd to ....app"; sourceTree = BUILT_PRODUCTS_DIR; };
8D1107320486CEB800E47090 /* >cd to ....app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; name = ">cd to ....app"; path = "cd to.app"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -213,6 +215,7 @@
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
6947E8C613DA6362008C982D /* lion.icns */,
693218A90E5BDADE00CFB0C3 /* leop_app.icns */,
694499460B86CEFC00A19631 /* LICENSE */,
694498870B86C47700A19631 /* app.icns */,
Expand Down Expand Up @@ -306,8 +309,11 @@
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0410;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "cd to ..." */;
compatibilityVersion = "Xcode 2.4";
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
Expand Down Expand Up @@ -370,6 +376,7 @@
694499470B86CEFC00A19631 /* LICENSE in Resources */,
693218AA0E5BDADE00CFB0C3 /* leop_app.icns in Resources */,
69C8AA71106E8F5800C4DE0D /* Finder.app in Resources */,
6947E8C713DA6362008C982D /* lion.icns in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -426,14 +433,13 @@
);
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = ">cd to ...";
PRODUCT_NAME = "cd to";
WRAPPER_EXTENSION = app;
ZERO_LINK = YES;
};
Expand All @@ -452,34 +458,30 @@
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = ">cd to ...";
PRODUCT_NAME = "cd to";
WRAPPER_EXTENSION = app;
};
name = Release;
};
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)";
ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386";
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.6;
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
SDKROOT = macosx;
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)";
ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386";
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.6;
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
SDKROOT = macosx;
};
name = Release;
};
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified graphics/leop_app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/leop_app_32px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified graphics/leop_app_src.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/lion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/lion_src.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lion.icns
Binary file not shown.
4 changes: 2 additions & 2 deletions main.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
NSMutableArray* pluginObjectArrays = [NSMutableArray array];
NSEnumerator *enumerator = [bundlePaths objectEnumerator];
NSString* path;
while (path = (NSString*)[enumerator nextObject]) {
while ((path = (NSString*)[enumerator nextObject])) {
NSBundle* bundle =[NSBundle bundleWithPath:path];
Class pClass =[bundle principalClass];
if([pClass conformsToProtocol:@protocol(CD2PluginProtocolV1)] && [pClass isKindOfClass:[NSObject class]]){
Expand All @@ -81,7 +81,7 @@ int main(int argc, char *argv[])

NSEnumerator *enumerator = [plugins objectEnumerator];
id <CD2PluginProtocolV1> plugin;
while (plugin = (id <CD2PluginProtocolV1>)[enumerator nextObject]) {
while ((plugin = (id <CD2PluginProtocolV1>)[enumerator nextObject])) {
[plugin openTermWindowForPath:path];
}

Expand Down
20 changes: 9 additions & 11 deletions plugins/X11_xterm/X11_xterm.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 42;
objectVersion = 46;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -141,8 +141,11 @@
/* Begin PBXProject section */
089C1669FE841209C02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0410;
};
buildConfigurationList = 1DEB913E08733D840010E9CD /* Build configuration list for PBXProject "X11_xterm" */;
compatibilityVersion = "Xcode 2.4";
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
Expand Down Expand Up @@ -197,7 +200,6 @@
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
Expand Down Expand Up @@ -233,24 +235,20 @@
1DEB913F08733D840010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)";
ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386";
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
SDKROOT = macosx;
};
name = Debug;
};
1DEB914008733D840010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)";
ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386";
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
SDKROOT = macosx;
};
name = Release;
};
Expand Down
8 changes: 4 additions & 4 deletions plugins/iterm/CD2ITerm.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ -(BOOL)openTermWindowForPath:(NSString*)aPath{
@try{
NSMutableString* fixQuotedPath = [[aPath mutableCopy]autorelease];

NSString* tCommandSequence =@"clear; cd $'%@'";
NSString* tCommandSequence =@"clear; cd '%@'";

[fixQuotedPath replaceOccurrencesOfString:@"'" withString:@"\\'" options:NSCaseInsensitiveSearch range:NSMakeRange(0,[fixQuotedPath length])];
[fixQuotedPath replaceOccurrencesOfString:@"'" withString:@"\"'\"" options:NSCaseInsensitiveSearch range:NSMakeRange(0,[fixQuotedPath length])];

iTermITermApplication* iterm = [SBApplication applicationWithBundleIdentifier:@"net.sourceforge.iTerm"];
iTermITermApplication* iterm = [SBApplication applicationWithBundleIdentifier:@"com.googlecode.iTerm2"];
[iterm activate];

bool isDefaultWindow =NO;
Expand All @@ -40,7 +40,7 @@ -(BOOL)openTermWindowForPath:(NSString*)aPath{
}

if(!isDefaultWindow){
terminal =[[[iterm classForScriptingClass:@"terminal"] alloc] init];
terminal =[[[[iterm classForScriptingClass:@"terminal"] alloc] init]autorelease];
[iterm.terminals addObject: terminal];
[terminal launchSession:@"Default Session"] ;
}
Expand Down
14 changes: 7 additions & 7 deletions plugins/iterm/iterm.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 42;
objectVersion = 46;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -144,8 +144,11 @@
/* Begin PBXProject section */
089C1669FE841209C02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0410;
};
buildConfigurationList = 1DEB913E08733D840010E9CD /* Build configuration list for PBXProject "iterm" */;
compatibilityVersion = "Xcode 2.4";
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
Expand Down Expand Up @@ -199,7 +202,6 @@
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
Expand Down Expand Up @@ -237,8 +239,7 @@
buildSettings = {
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
SDKROOT = macosx;
};
name = Debug;
};
Expand All @@ -247,8 +248,7 @@
buildSettings = {
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
SDKROOT = macosx;
};
name = Release;
};
Expand Down
42 changes: 6 additions & 36 deletions plugins/terminal/CD2Terminal.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,48 +14,18 @@ @implementation CD2Terminal

-(BOOL)openTermWindowForPath:(NSString*)aPath{
@try{
//fix quoting issue
NSMutableString* fixQuotedPath = [[aPath mutableCopy]autorelease];
[fixQuotedPath replaceOccurrencesOfString:@"'" withString:@"\\'" options:NSCaseInsensitiveSearch range:NSMakeRange(0,[fixQuotedPath length])];
/* [fixQuotedPath replaceOccurrencesOfString:@"\"" withString:@"\\\"" options:NSCaseInsensitiveSearch range:NSMakeRange(0,[fixQuotedPath length])];
[fixQuotedPath replaceOccurrencesOfString:@" " withString:@"\\ " options:NSCaseInsensitiveSearch range:NSMakeRange(0,[fixQuotedPath length])];
[fixQuotedPath replaceOccurrencesOfString:@"'" withString:@"\\'" options:NSCaseInsensitiveSearch range:NSMakeRange(0,[fixQuotedPath length])];
[fixQuotedPath replaceOccurrencesOfString:@"`" withString:@"\\`" options:NSCaseInsensitiveSearch range:NSMakeRange(0,[fixQuotedPath length])];
[fixQuotedPath replaceOccurrencesOfString:@")" withString:@"\\)" options:NSCaseInsensitiveSearch range:NSMakeRange(0,[fixQuotedPath length])];
[fixQuotedPath replaceOccurrencesOfString:@"(" withString:@"\\(" options:NSCaseInsensitiveSearch range:NSMakeRange(0,[fixQuotedPath length])];
*/

NSString* tCommandSequence =@"printf %%b '\\033c'; cd $'%@'";


TerminalApplication* terminal = [SBApplication applicationWithBundleIdentifier:@"com.apple.Terminal"];

[terminal activate];

[terminal activate];



bool isDefaultWindow =NO;
if([[[terminal windows] get] count] ==1 ){
TerminalWindow* firstTermWindow =[[terminal windows] objectAtIndex:0];
TerminalTab* firstTab =[[firstTermWindow tabs] objectAtIndex:0];

if(!firstTab.busy){
NSString* windowContents = firstTab.contents;
int originalLength = [windowContents length];

NSMutableString *mutableContents = [[windowContents mutableCopy] autorelease];
NSMutableString *mutableContents2 = [[windowContents mutableCopy] autorelease];
[mutableContents replaceOccurrencesOfString:@"$" withString:@"" options:NSCaseInsensitiveSearch range:NSMakeRange(0,[mutableContents length])];
[mutableContents2 replaceOccurrencesOfString:@"Last login" withString:@"" options:NSCaseInsensitiveSearch range:NSMakeRange(0,[mutableContents2 length])];

if([mutableContents length]+1 == originalLength && [mutableContents2 length] < originalLength ){
isDefaultWindow =YES;
[terminal doScript:[NSString stringWithFormat:tCommandSequence,fixQuotedPath,nil] in:firstTermWindow];

}
}
}

if(!isDefaultWindow){
[terminal doScript:[NSString stringWithFormat:tCommandSequence,fixQuotedPath,nil] in:nil];
}
[terminal open:[NSArray arrayWithObject:aPath]];
return YES;
}@catch(id ue) {

Expand Down
Loading

0 comments on commit 5479e76

Please sign in to comment.