From db0bb87340271e90a4c10c271e646a7ac80c06f0 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Wed, 3 Feb 2010 18:40:01 -0700 Subject: [PATCH] Add Open in Terminal to the Repository menu. Code came from B. Ohr at: http://groups.google.com/group/gitx/browse_thread/thread/a103df7ef7c1f037 Added quotes to workingDirectory path to support paths with spaces. --- English.lproj/MainMenu.xib | 1328 ++++++++++++++++++++++++++++---- GitX.xcodeproj/project.pbxproj | 6 + PBGitWindowController.h | 1 + PBGitWindowController.m | 11 + Terminal.h | 159 ++++ 5 files changed, 1357 insertions(+), 148 deletions(-) create mode 100644 Terminal.h diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index 8dbbc74..cf17779 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -1,14 +1,18 @@ - + 1050 - 9G55 - 677 - 949.43 - 353.00 + 10C540 + 732 + 1038.25 + 458.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 732 + YES - + YES @@ -16,7 +20,7 @@ YES - + YES @@ -80,7 +84,7 @@ - RW5hYmxlIFRlcm1pbmFsIFVzYWdl4oCmA + Enable Terminal Usage… 1048576 2147483647 @@ -89,7 +93,7 @@ - UHJlZmVyZW5jZXPigKY + Preferences… , 1048576 2147483647 @@ -98,7 +102,7 @@ - Q2hlY2sgZm9yIFVwZGF0ZXPigKY + Check for Updates… 2147483647 @@ -213,7 +217,7 @@ YES - TmV34oCmA + New… n 1048576 2147483647 @@ -222,7 +226,7 @@ - T3BlbuKApg + Open… o 1048576 2147483647 @@ -288,7 +292,7 @@ - U2F2ZSBBc+KApg + Save As… S 1048576 2147483647 @@ -316,7 +320,7 @@ - UGFnZSBTZXR1cOKApg + Page Setup… P 1048576 2147483647 @@ -325,7 +329,7 @@ - UHJpbnTigKY + Print… p 1048576 2147483647 @@ -452,7 +456,7 @@ YES - RmluZOKApg + Find… f 1048576 2147483647 @@ -517,7 +521,7 @@ YES - U2hvdyBTcGVsbGluZ+KApg + Show Spelling… : 1048576 2147483647 @@ -632,6 +636,48 @@ + + + Repository + + 2147483647 + + + submenuAction: + + Repository + + YES + + + Create Branch + b + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Open In Terminal + + 2147483647 + + + + + + View @@ -656,7 +702,7 @@ - Q3VzdG9taXplIFRvb2xiYXLigKY + Customize Toolbar… 1048576 2147483647 @@ -1220,34 +1266,48 @@ 934 + + + createBranch: + + + + 941 + + + + openInTerminal: + + + + 944 + YES 0 - - YES - + -2 - - RmlsZSdzIE93bmVyA + + File's Owner -1 - + First Responder -3 - + Application @@ -1261,8 +1321,9 @@ + - + MainMenu @@ -1792,7 +1853,7 @@ 205 - + ApplicationController @@ -1818,7 +1879,7 @@ 908 - + 909 @@ -1828,7 +1889,7 @@ 912 - + 915 @@ -1843,7 +1904,7 @@ 918 - + 919 @@ -1865,14 +1926,47 @@ + + 936 + + + YES + + + + + + 937 + + + YES + + + + + + + + 938 + + + + + 942 + + + + + 943 + + + YES - + YES - -1.IBPluginDependency - -2.IBPluginDependency -3.IBPluginDependency -3.ImportedFromIB2 103.IBPluginDependency @@ -1886,6 +1980,7 @@ 112.ImportedFromIB2 124.IBPluginDependency 124.ImportedFromIB2 + 125.IBEditorWindowLastContentRect 125.IBPluginDependency 125.ImportedFromIB2 126.IBPluginDependency @@ -1920,6 +2015,7 @@ 157.ImportedFromIB2 158.IBPluginDependency 158.ImportedFromIB2 + 159.IBEditorWindowLastContentRect 159.IBPluginDependency 159.ImportedFromIB2 160.IBPluginDependency @@ -1950,6 +2046,7 @@ 174.ImportedFromIB2 184.IBPluginDependency 184.ImportedFromIB2 + 185.IBEditorWindowLastContentRect 185.IBPluginDependency 185.ImportedFromIB2 187.IBPluginDependency @@ -1960,12 +2057,12 @@ 191.ImportedFromIB2 196.IBPluginDependency 196.ImportedFromIB2 - 205.IBPluginDependency 205.ImportedFromIB2 212.IBPluginDependency 212.ImportedFromIB2 214.IBPluginDependency 214.ImportedFromIB2 + 215.IBEditorWindowLastContentRect 215.IBPluginDependency 215.ImportedFromIB2 216.IBPluginDependency @@ -1976,6 +2073,7 @@ 219.ImportedFromIB2 224.IBPluginDependency 224.ImportedFromIB2 + 225.IBEditorWindowLastContentRect 225.IBPluginDependency 225.ImportedFromIB2 227.IBPluginDependency @@ -2045,189 +2143,195 @@ 848.IBPluginDependency 851.IBPluginDependency 852.IBPluginDependency - 908.IBPluginDependency 909.IBPluginDependency 912.IBPluginDependency 915.IBPluginDependency 916.IBPluginDependency - 918.IBPluginDependency 919.IBPluginDependency 927.IBPluginDependency 928.IBPluginDependency 929.IBPluginDependency + 936.IBPluginDependency + 937.IBEditorWindowLastContentRect + 937.IBPluginDependency + 938.IBPluginDependency + 942.IBPluginDependency + 943.IBPluginDependency YES com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + {{880, 713}, {135, 23}} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - - {{789, 713}, {138, 23}} + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + + {{778, 673}, {143, 23}} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + + {{864, 473}, {238, 103}} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + + {{624, 493}, {240, 243}} com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{370, 623}, {243, 243}} - com.apple.InterfaceBuilder.CocoaPlugin - + {{455, 493}, {243, 243}} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + + {{864, 473}, {272, 83}} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + + {{864, 473}, {212, 63}} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + + {{864, 473}, {150, 43}} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + + {{809, 663}, {194, 73}} com.apple.InterfaceBuilder.CocoaPlugin - - {{718, 767}, {197, 73}} + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + + {{521, 736}, {420, 20}} com.apple.InterfaceBuilder.CocoaPlugin - - {{521, 736}, {329, 20}} - com.apple.InterfaceBuilder.CocoaPlugin - + {{297, 739}, {329, 20}} com.apple.InterfaceBuilder.CocoaPlugin - - {{668, 647}, {234, 193}} + + {{759, 543}, {231, 193}} com.apple.InterfaceBuilder.CocoaPlugin - + {{499, 623}, {234, 113}} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - - {{533, 513}, {262, 223}} + + {{533, 513}, {259, 223}} com.apple.InterfaceBuilder.CocoaPlugin - + {{309, 536}, {262, 203}} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - - {{582, 533}, {199, 203}} + + {{582, 533}, {196, 203}} com.apple.InterfaceBuilder.CocoaPlugin - + {{358, 536}, {199, 203}} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2241,14 +2345,16 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + {{668, 683}, {192, 53}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin YES - - YES - + YES @@ -2256,15 +2362,13 @@ YES - - YES - + YES - 934 + 944 @@ -2274,12 +2378,12 @@ NSObject YES - + YES installCliTool: openPreferencesWindow: - showAboutPanel: saveAction: + showAboutPanel: showHelp: @@ -2293,7 +2397,7 @@ YES - + YES firstResponder window @@ -2322,7 +2426,7 @@ NSObject YES - + YES setDetailedView: setRawView: @@ -2341,14 +2445,22 @@ - PBGitCommitController - PBViewController + PBCollapsibleSplitView + PBNiceSplitView + + IBProjectSource + PBCollapsibleSplitView.h + + + + PBCreateBranchSheet + NSWindowController YES - + YES - commit: - refresh: + closeCreateBranchSheet: + createBranch: YES @@ -2358,9 +2470,52 @@ YES - + + YES + branchName + errorMessage + isTrackingBranch + remoteMenu + remotePopup + + + YES + NSTextField + NSTextField + NSButton + NSMenu + NSPopUpButton + + + + IBProjectSource + PBCreateBranchSheet.h + + + + PBGitCommitController + PBViewController + + YES + + YES + commit: + refresh: + signOff: + + + YES + id + id + id + + + + YES + YES cachedFilesController + commitButton commitMessageView indexController unstagedFilesController @@ -2369,10 +2524,11 @@ YES NSArrayController + NSButton NSTextView - id + PBGitIndexController NSArrayController - id + PBWebChangesController @@ -2385,13 +2541,17 @@ PBViewController YES - + YES + createBranch: + openFilesAction: openSelectedFile: refresh: setDetailedView: setRawView: setTreeView: + showCommitsFromTree: + showInFinderAction: toggleQuickView: @@ -2402,15 +2562,20 @@ id id id + id + id + id + id YES - + YES commitController commitList fileBrowser + historySplitView searchField treeController webView @@ -2420,6 +2585,7 @@ NSArrayController NSTableView NSOutlineView + PBCollapsibleSplitView NSSearchField NSTreeController id @@ -2430,13 +2596,54 @@ PBGitHistoryController.h + + PBGitIndexController + NSObject + + YES + + YES + rowClicked: + tableClicked: + + + YES + NSCell + NSTableView + + + + YES + + YES + commitController + stagedFilesController + stagedTable + unstagedFilesController + unstagedTable + + + YES + PBGitCommitController + NSArrayController + NSTableView + NSArrayController + NSTableView + + + + IBProjectSource + PBGitIndexController.h + + PBGitWindowController NSWindowController YES - + YES + openInTerminal: showCommitView: showHistoryView: @@ -2444,6 +2651,7 @@ YES id id + id @@ -2460,7 +2668,7 @@ NSWindowController YES - + YES openSelectedFile: refresh: @@ -2481,7 +2689,7 @@ YES - + YES commitController commitList @@ -2501,6 +2709,14 @@ + + PBNiceSplitView + NSSplitView + + IBProjectSource + PBNiceSplitView.h + + PBRepositoryDocumentController NSDocumentController @@ -2529,6 +2745,52 @@ PBViewController.h + + PBWebChangesController + PBWebController + + YES + + YES + cachedFilesController + controller + indexController + unstagedFilesController + + + YES + NSArrayController + PBGitCommitController + PBGitIndexController + NSArrayController + + + + IBProjectSource + PBWebChangesController.h + + + + PBWebController + NSObject + + YES + + YES + repository + view + + + YES + id + WebView + + + + IBProjectSource + PBWebController.h + + YES @@ -2553,8 +2815,778 @@ + + YES + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSArrayController + NSObjectController + + IBFrameworkSource + AppKit.framework/Headers/NSArrayController.h + + + + NSBrowser + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSBrowser.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSController + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSController.h + + + + NSDocument + NSObject + + YES + + YES + printDocument: + revertDocumentToSaved: + runPageLayout: + saveDocument: + saveDocumentAs: + saveDocumentTo: + + + YES + id + id + id + id + id + id + + + + IBFrameworkSource + AppKit.framework/Headers/NSDocument.h + + + + NSDocument + + IBFrameworkSource + AppKit.framework/Headers/NSDocumentScripting.h + + + + NSDocumentController + NSObject + + YES + + YES + clearRecentDocuments: + newDocument: + openDocument: + saveAllDocuments: + + + YES + id + id + id + id + + + + IBFrameworkSource + AppKit.framework/Headers/NSDocumentController.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSManagedObjectContext + NSObject + + IBFrameworkSource + CoreData.framework/Headers/NSManagedObjectContext.h + + + + NSMatrix + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSMatrix.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSMenuItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSMovieView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSMovieView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUAppcast.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebDownload.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebEditingDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebFrameLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebJavaPlugIn.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPlugin.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPluginContainer.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPolicyDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebResourceLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebScriptObject.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebUIDelegate.h + + + + NSObjectController + NSController + + IBFrameworkSource + AppKit.framework/Headers/NSObjectController.h + + + + NSOutlineView + NSTableView + + + + NSPopUpButton + NSButton + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButton.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSSearchField + NSTextField + + IBFrameworkSource + AppKit.framework/Headers/NSSearchField.h + + + + NSSplitView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSSplitView.h + + + + NSTableView + NSControl + + + + NSText + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSText.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextView + NSText + + IBFrameworkSource + AppKit.framework/Headers/NSTextView.h + + + + NSToolbar + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbar.h + + + + NSTreeController + NSObjectController + + IBFrameworkSource + AppKit.framework/Headers/NSTreeController.h + + + + NSUserDefaultsController + NSController + + IBFrameworkSource + AppKit.framework/Headers/NSUserDefaultsController.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSViewController + NSResponder + + view + NSView + + + IBFrameworkSource + AppKit.framework/Headers/NSViewController.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + NSWindowController + NSResponder + + showWindow: + id + + + IBFrameworkSource + AppKit.framework/Headers/NSWindowController.h + + + + SUUpdater + NSObject + + checkForUpdates: + id + + + delegate + id + + + + + WebView + NSView + + YES + + YES + goBack: + goForward: + makeTextLarger: + makeTextSmaller: + makeTextStandardSize: + reload: + reloadFromOrigin: + stopLoading: + takeStringURLFrom: + toggleContinuousSpellChecking: + toggleSmartInsertDelete: + + + YES + id + id + id + id + id + id + id + id + id + id + id + + + + IBFrameworkSource + WebKit.framework/Headers/WebView.h + + + 0 + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES ../GitX.xcodeproj 3 diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index 01cb711..5d2238f 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -46,6 +46,7 @@ D26DC6450E782C9000C777B2 /* gitx.icns in Resources */ = {isa = PBXBuildFile; fileRef = D26DC6440E782C9000C777B2 /* gitx.icns */; }; D854948610D5C01B0083B917 /* PBCreateBranchSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */; }; D85B939310E3D8B4007F3C28 /* PBCreateBranchSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */; }; + D8E3B2B810DC9FB2001096A3 /* ScriptingBridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8E3B2B710DC9FB2001096A3 /* ScriptingBridge.framework */; }; EB2A734A0FEE3F09006601CF /* PBCollapsibleSplitView.m in Sources */ = {isa = PBXBuildFile; fileRef = EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */; }; F50A411F0EBB874C00208746 /* mainSplitterBar.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F50A411D0EBB874C00208746 /* mainSplitterBar.tiff */; }; F50A41200EBB874C00208746 /* mainSplitterDimple.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F50A411E0EBB874C00208746 /* mainSplitterDimple.tiff */; }; @@ -210,10 +211,12 @@ 93F7857E0EA3ABF100C1F443 /* PBCommitMessageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCommitMessageView.m; sourceTree = ""; }; 93FCCBA80EA8AF450061B02B /* PBGitConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitConfig.m; sourceTree = ""; }; D26DC6440E782C9000C777B2 /* gitx.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = gitx.icns; sourceTree = ""; }; + D823487410CB382C00944BDE /* Terminal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Terminal.h; sourceTree = ""; }; D854948410D5C01B0083B917 /* PBCreateBranchSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCreateBranchSheet.h; sourceTree = ""; }; D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCreateBranchSheet.m; sourceTree = ""; }; D854949310D5C3E20083B917 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCreateBranchSheet.xib; sourceTree = ""; }; D85B93F610E51279007F3C28 /* PBGitRefish.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRefish.h; sourceTree = ""; }; + D8E3B2B710DC9FB2001096A3 /* ScriptingBridge.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ScriptingBridge.framework; path = /System/Library/Frameworks/ScriptingBridge.framework; sourceTree = ""; }; EB2A73480FEE3F09006601CF /* PBCollapsibleSplitView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCollapsibleSplitView.h; sourceTree = ""; }; EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCollapsibleSplitView.m; sourceTree = ""; }; F50A411D0EBB874C00208746 /* mainSplitterBar.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = mainSplitterBar.tiff; path = Images/mainSplitterBar.tiff; sourceTree = ""; }; @@ -329,6 +332,7 @@ F580E6AE0E733276009E2D3F /* Sparkle.framework in Frameworks */, F5E4DBFB0EAB58D90013FAFC /* SystemConfiguration.framework in Frameworks */, F5C580E50EDA250900995434 /* libgit2.a in Frameworks */, + D8E3B2B810DC9FB2001096A3 /* ScriptingBridge.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -384,6 +388,7 @@ 77C82804067257F0000B614F /* CoreData.framework */, 29B97325FDCFA39411CA2CEA /* Foundation.framework */, 29B97324FDCFA39411CA2CEA /* AppKit.framework */, + D8E3B2B710DC9FB2001096A3 /* ScriptingBridge.framework */, ); name = "Other Frameworks"; sourceTree = ""; @@ -586,6 +591,7 @@ EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */, F5FC41F20EBCBD4300191D80 /* PBGitXProtocol.h */, F5FC41F30EBCBD4300191D80 /* PBGitXProtocol.m */, + D823487410CB382C00944BDE /* Terminal.h */, ); name = Aux; sourceTree = ""; diff --git a/PBGitWindowController.h b/PBGitWindowController.h index b262fed..d40d436 100644 --- a/PBGitWindowController.h +++ b/PBGitWindowController.h @@ -35,4 +35,5 @@ - (IBAction) showCommitView:(id)sender; - (IBAction) showHistoryView:(id)sender; +- (IBAction) openInTerminal:(id)sender; @end diff --git a/PBGitWindowController.m b/PBGitWindowController.m index 7e277e1..0d7b8ee 100644 --- a/PBGitWindowController.m +++ b/PBGitWindowController.m @@ -9,6 +9,7 @@ #import "PBGitWindowController.h" #import "PBGitHistoryController.h" #import "PBGitCommitController.h" +#import "Terminal.h" @implementation PBGitWindowController @@ -149,6 +150,16 @@ [self showErrorSheet:error]; } +- (IBAction) openInTerminal:(id)sender +{ + TerminalApplication *term = [SBApplication applicationWithBundleIdentifier: @"com.apple.Terminal"]; + NSString *workingDirectory = [[repository workingDirectory] stringByAppendingString:@"/"]; + NSString *cmd = [NSString stringWithFormat: @"cd \"%@\"; clear; echo '# Opened by GitX:'; git status", workingDirectory]; + [term doScript: cmd in: nil]; + [NSThread sleepForTimeInterval: 0.1]; + [term activate]; +} + #pragma mark - #pragma mark Toolbar Delegates diff --git a/Terminal.h b/Terminal.h new file mode 100644 index 0000000..8050370 --- /dev/null +++ b/Terminal.h @@ -0,0 +1,159 @@ +/* + * Terminal.h + */ + +#import +#import + + +@class TerminalApplication, TerminalWindow, TerminalSettingsSet, TerminalTab; + +typedef enum { + TerminalSaveOptionsYes = 'yes ' /* Save the file. */, + TerminalSaveOptionsNo = 'no ' /* Do not save the file. */, + TerminalSaveOptionsAsk = 'ask ' /* Ask the user whether or not to save the file. */ +} TerminalSaveOptions; + +typedef enum { + TerminalPrintingErrorHandlingStandard = 'lwst' /* Standard PostScript error handling */, + TerminalPrintingErrorHandlingDetailed = 'lwdt' /* print a detailed report of PostScript errors */ +} TerminalPrintingErrorHandling; + + + +/* + * Standard Suite + */ + +// The application‘s top-level scripting object. +@interface TerminalApplication : SBApplication + +- (SBElementArray *) windows; + +@property (copy, readonly) NSString *name; // The name of the application. +@property (readonly) BOOL frontmost; // Is this the frontmost (active) application? +@property (copy, readonly) NSString *version; // The version of the application. + +- (void) open:(NSArray *)x; // Open a document. +- (void) print:(id)x withProperties:(NSDictionary *)withProperties printDialog:(BOOL)printDialog; // Print a document. +- (void) quitSaving:(TerminalSaveOptions)saving; // Quit the application. +- (TerminalTab *) doScript:(NSString *)x in:(id)in_; // Runs a UNIX shell script or command. + +@end + +// A window. +@interface TerminalWindow : SBObject + +- (SBElementArray *) tabs; + +@property (copy, readonly) NSString *name; // The full title of the window. +- (NSInteger) id; // The unique identifier of the window. +@property NSInteger index; // The index of the window, ordered front to back. +@property NSRect bounds; // The bounding rectangle of the window. +@property (readonly) BOOL closeable; // Whether the window has a close box. +@property (readonly) BOOL miniaturizable; // Whether the window can be minimized. +@property BOOL miniaturized; // Whether the window is currently minimized. +@property (readonly) BOOL resizable; // Whether the window can be resized. +@property BOOL visible; // Whether the window is currently visible. +@property (readonly) BOOL zoomable; // Whether the window can be zoomed. +@property BOOL zoomed; // Whether the window is currently zoomed. +@property BOOL frontmost; // Whether the window is currently the frontmost Terminal window. +@property NSPoint position; // The position of the window, relative to the upper left corner of the screen. +@property NSPoint origin; // The position of the window, relative to the lower left corner of the screen. +@property NSPoint size; // The width and height of the window +@property NSRect frame; // The bounding rectangle, relative to the lower left corner of the screen. + +- (void) closeSaving:(TerminalSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document. +- (void) saveIn:(NSURL *)in_; // Save a document. +- (void) printWithProperties:(NSDictionary *)withProperties printDialog:(BOOL)printDialog; // Print a document. +- (void) delete; // Delete an object. +- (void) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location. +- (BOOL) exists; // Verify if an object exists. +- (void) moveTo:(SBObject *)to; // Move object(s) to a new location. + +@end + + + +/* + * Terminal Suite + */ + +@interface TerminalApplication (TerminalSuite) + +- (SBElementArray *) settingsSets; + +@property (copy) TerminalSettingsSet *defaultSettings; // The settings set used for new windows. +@property (copy) TerminalSettingsSet *startupSettings; // The settings set used for the window created on application startup. + +@end + +// A set of settings. +@interface TerminalSettingsSet : SBObject + +- (NSInteger) id; // The unique identifier of the settings set. +@property (copy) NSString *name; // The name of the settings set. +@property NSInteger numberOfRows; // The number of rows displayed in the tab. +@property NSInteger numberOfColumns; // The number of columns displayed in the tab. +@property (copy) NSColor *cursorColor; // The cursor color for the tab. +@property (copy) NSColor *backgroundColor; // The background color for the tab. +@property (copy) NSColor *normalTextColor; // The normal text color for the tab. +@property (copy) NSColor *boldTextColor; // The bold text color for the tab. +@property (copy) NSString *fontName; // The name of the font used to display the tab’s contents. +@property NSInteger fontSize; // The size of the font used to display the tab’s contents. +@property BOOL fontAntialiasing; // Whether the font used to display the tab’s contents is antialiased. +@property (copy) NSArray *cleanCommands; // The processes which will be ignored when checking whether a tab can be closed without showing a prompt. +@property BOOL titleDisplaysDeviceName; // Whether the title contains the device name. +@property BOOL titleDisplaysShellPath; // Whether the title contains the shell path. +@property BOOL titleDisplaysWindowSize; // Whether the title contains the tab’s size, in rows and columns. +@property BOOL titleDisplaysSettingsName; // Whether the title contains the settings name. +@property BOOL titleDisplaysCustomTitle; // Whether the title contains a custom title. +@property (copy) NSString *customTitle; // The tab’s custom title. + +- (void) closeSaving:(TerminalSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document. +- (void) saveIn:(NSURL *)in_; // Save a document. +- (void) printWithProperties:(NSDictionary *)withProperties printDialog:(BOOL)printDialog; // Print a document. +- (void) delete; // Delete an object. +- (void) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location. +- (BOOL) exists; // Verify if an object exists. +- (void) moveTo:(SBObject *)to; // Move object(s) to a new location. + +@end + +// A tab. +@interface TerminalTab : SBObject + +@property NSInteger numberOfRows; // The number of rows displayed in the tab. +@property NSInteger numberOfColumns; // The number of columns displayed in the tab. +@property (copy, readonly) NSString *contents; // The currently visible contents of the tab. +@property (copy, readonly) NSString *history; // The contents of the entire scrolling buffer of the tab. +@property (readonly) BOOL busy; // Whether the tab is busy running a process. +@property (copy, readonly) NSArray *processes; // The processes currently running in the tab. +@property BOOL selected; // Whether the tab is selected. +@property BOOL titleDisplaysCustomTitle; // Whether the title contains a custom title. +@property (copy) NSString *customTitle; // The tab’s custom title. +@property (copy, readonly) NSString *tty; // The tab’s TTY device. +@property (copy) TerminalSettingsSet *currentSettings; // The set of settings which control the tab’s behavior and appearance. +@property (copy) NSColor *cursorColor; // The cursor color for the tab. +@property (copy) NSColor *backgroundColor; // The background color for the tab. +@property (copy) NSColor *normalTextColor; // The normal text color for the tab. +@property (copy) NSColor *boldTextColor; // The bold text color for the tab. +@property (copy) NSArray *cleanCommands; // The processes which will be ignored when checking whether a tab can be closed without showing a prompt. +@property BOOL titleDisplaysDeviceName; // Whether the title contains the device name. +@property BOOL titleDisplaysShellPath; // Whether the title contains the shell path. +@property BOOL titleDisplaysWindowSize; // Whether the title contains the tab’s size, in rows and columns. +@property BOOL titleDisplaysFileName; // Whether the title contains the file name. +@property (copy) NSString *fontName; // The name of the font used to display the tab’s contents. +@property NSInteger fontSize; // The size of the font used to display the tab’s contents. +@property BOOL fontAntialiasing; // Whether the font used to display the tab’s contents is antialiased. + +- (void) closeSaving:(TerminalSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document. +- (void) saveIn:(NSURL *)in_; // Save a document. +- (void) printWithProperties:(NSDictionary *)withProperties printDialog:(BOOL)printDialog; // Print a document. +- (void) delete; // Delete an object. +- (void) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location. +- (BOOL) exists; // Verify if an object exists. +- (void) moveTo:(SBObject *)to; // Move object(s) to a new location. + +@end +