Browse files

Removed git features

  • Loading branch information...
1 parent cb3d6bd commit e56b69506a8f5c898e7f098e34ba5c117552f6a0 @soffes soffes committed May 28, 2011
View
2 Changelog.markdown
@@ -1,7 +1,7 @@
### 2011-05-28
* Added version to Missing Drawer and display it in preferences
-* Added preferences UI for colors, the Terminal button, and the git button. Thanks [@shell](http://github.com/shell) for the initial work on this and the git button.
+* Added preferences UI for colors (thanks [@shell](http://github.com/shell)) and the terminal button.
### 2010-11-28
View
2 Classes/MDMissingDrawer.h
@@ -36,6 +36,8 @@
}
// Class Methods
++ (NSBundle *)pluginBundle;
++ (NSImage *)bundledImageWithName:(NSString *)imageName;
+ (MDSplitView *)makeSplitViewWithMainView:(NSView *)contentView sideView:(NSView *)sideView;
// Plugin hook
View
11 Classes/MDMissingDrawer.m
@@ -51,6 +51,17 @@ @implementation MDMissingDrawer
#pragma mark Class Methods
++ (NSBundle *)pluginBundle {
+ return [NSBundle bundleForClass:[self class]];
+}
+
+
++ (NSImage *)bundledImageWithName:(NSString *)imageName {
+ NSBundle *pluginBundle = [[self class] pluginBundle];
+ return [[[NSImage alloc] initWithContentsOfFile:[pluginBundle pathForResource:imageName ofType:@"png"]] autorelease];
+}
+
+
+ (MDSplitView *)makeSplitViewWithMainView:(NSView *)contentView sideView:(NSView *)sideView {
MDLog();
MDSplitView *splitView = [[MDSplitView alloc] initWithFrame:[contentView frame] mainView:contentView sideView:sideView];
View
4 Classes/MDSidebarBorderView.h
@@ -33,14 +33,10 @@
id<NSObject> _projectFileOutlineView;
}
-// Class Methods
-+ (NSImage *)bundledImageWithName:(NSString *)imageName;
-
// Drawing
- (void)addToSuperview:(NSView *)superview;
// Actions
- (void)terminalButtonPressed:(id)sender;
-- (void)gitButtonPressed:(id)sender;
@end
View
69 Classes/MDSidebarBorderView.m
@@ -28,8 +28,8 @@
#import "MDSidebarBorderView.h"
#import "MDResizer.h"
-#import "Foundation/NSGeometry.h"
#import "MDSettings.h"
+#import "MDMissingDrawer.h"
NSComparisonResult compareFrameOriginX(id viewA, id viewB, void *context) {
float v1 = [viewA frame].origin.x;
@@ -51,14 +51,6 @@ - (NSString *)_selectedFilePath;
@implementation MDSidebarBorderView
-#pragma mark Class Methods
-
-+ (NSImage *)bundledImageWithName:(NSString *)imageName {
- NSBundle *pluginBundle = [NSBundle bundleForClass:[self class]];
- return [[[NSImage alloc] initWithContentsOfFile:[pluginBundle pathForResource:imageName ofType:@"png"]] autorelease];
-}
-
-
#pragma mark NSView
- (BOOL)mouseDownCanMoveWindow {
@@ -68,7 +60,7 @@ - (BOOL)mouseDownCanMoveWindow {
- (void)drawRect:(NSRect)rect {
NSRect fromRect = NSZeroRect;
- NSImage *image = [MDSidebarBorderView bundledImageWithName:@"DrawerBorder"];
+ NSImage *image = [MDMissingDrawer bundledImageWithName:@"DrawerBorder"];
fromRect.size = [image size];
[image drawInRect:[self frame] fromRect:fromRect operation:NSCompositeSourceOver fraction:1.0];
@@ -83,15 +75,15 @@ - (void)addToSuperview:(NSView *)superview {
BOOL showSidebarOnLeft = [[MDSettings defaultSettings] showSideViewOnLeft];
// Adjust frame
- NSImage *image = [MDSidebarBorderView bundledImageWithName:@"DrawerBorder"];
+ NSImage *image = [MDMissingDrawer bundledImageWithName:@"DrawerBorder"];
NSRect borderRect = NSZeroRect;
borderRect.origin.x = showSidebarOnLeft ? -1.0 : 1.0;
borderRect.size.height = [image size].height;
borderRect.size.width = [superview frame].size.width + 2;
// Add resizer image
NSRect handleRect = NSZeroRect;
- NSImage *sidebarResizerImage = [MDSidebarBorderView bundledImageWithName:@"DrawerResizeHandle"];
+ NSImage *sidebarResizerImage = [MDMissingDrawer bundledImageWithName:@"DrawerResizeHandle"];
handleRect.size = [sidebarResizerImage size];
handleRect.origin.y = 0;
if (showSidebarOnLeft) {
@@ -127,16 +119,16 @@ - (void)addToSuperview:(NSView *)superview {
[btns sortUsingFunction:(NSInteger (*)(id, id, void *))compareFrameOriginX context:nil];
- NSRect tmButtonFrame = [[btns lastObject] frame];
- NSRect buttonFrame = NSMakeRect(tmButtonFrame.origin.x + tmButtonFrame.size.width, tmButtonFrame.origin.y,
- 23.0f, tmButtonFrame.size.height);
-
// Terminal button
if ([[NSUserDefaults standardUserDefaults] boolForKey:kMDTerminalButtonEnabledKey]) {
+ NSRect tmButtonFrame = [[btns lastObject] frame];
+ NSRect buttonFrame = NSMakeRect(tmButtonFrame.origin.x + tmButtonFrame.size.width, tmButtonFrame.origin.y,
+ 23.0f, tmButtonFrame.size.height);
+
NSButton *terminalButton = [[NSButton alloc] initWithFrame:buttonFrame];
- NSImage *buttonImage = [MDSidebarBorderView bundledImageWithName:@"ButtonTerminal"];
- NSImage *buttonImagePressed = [MDSidebarBorderView bundledImageWithName:@"ButtonTerminalPressed"];
+ NSImage *buttonImage = [MDMissingDrawer bundledImageWithName:@"ButtonTerminal"];
+ NSImage *buttonImagePressed = [MDMissingDrawer bundledImageWithName:@"ButtonTerminalPressed"];
[terminalButton setToolTip:@"Open Terminal window and 'cd' to selected file/folder"];
[terminalButton setImage:buttonImage];
@@ -147,28 +139,6 @@ - (void)addToSuperview:(NSView *)superview {
[terminalButton setBordered:NO];
[btns addObject:terminalButton];
[terminalButton release];
-
- // Move over for git button
- buttonFrame = NSMakeRect(buttonFrame.origin.x + buttonFrame.size.width, buttonFrame.origin.y,
- buttonFrame.size.width, buttonFrame.size.height);
- }
-
- // Git button
- if ([[NSUserDefaults standardUserDefaults] boolForKey:kMDGitButtonEnabledKey]) {
- NSButton *gitButton = [[NSButton alloc] initWithFrame:buttonFrame];
-
- NSImage *gitButtonImage = [MDSidebarBorderView bundledImageWithName:@"ButtonGit"];
- NSImage *gitButtonImagePressed = [MDSidebarBorderView bundledImageWithName:@"ButtonGitPressed"];
-
- [gitButton setToolTip:@"Open git window here"];
- [gitButton setImage:gitButtonImage];
- [gitButton setAlternateImage:gitButtonImagePressed];
- [gitButton setAction:@selector(gitButtonPressed:)];
- [gitButton setTarget:self];
-
- [gitButton setBordered:NO];
- [btns addObject:gitButton];
- [gitButton release];
}
// Adjust outlineView frame
@@ -235,25 +205,6 @@ - (void)terminalButtonPressed:(id)sender {
[as executeAndReturnError:nil];
[as release];
return;
-}
-
-- (void)gitButtonPressed:(id)sender {
- NSString *path = [self _selectedFilePath];
- if (!path) {
- return;
- }
-
- // Try to launch GitX
- if (![[NSWorkspace sharedWorkspace] openFile:path withApplication:@"GitX"]) {
- // Otherwise launch gitk
- // TODO: Fix
-// NSTask *task = [[NSTask alloc] init];
-// [task setLaunchPath:@"/usr/local/bin/gitk"];
-// [task setCurrentDirectoryPath:path];
-// [task launch];
-// [task waitUntilExit];
-// [task release];
- }
}
View
24 MissingDrawer.xcodeproj/project.pbxproj
@@ -13,8 +13,6 @@
17A67ED81220168000BECE6F /* defaultSettings.plist in Resources */ = {isa = PBXBuildFile; fileRef = 17A67ED71220168000BECE6F /* defaultSettings.plist */; };
8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; };
B21734D813916D0200299F09 /* MDDefines.m in Sources */ = {isa = PBXBuildFile; fileRef = B21734D713916D0200299F09 /* MDDefines.m */; };
- B21734ED13916FBD00299F09 /* ButtonGit.png in Resources */ = {isa = PBXBuildFile; fileRef = B21734E513916FBD00299F09 /* ButtonGit.png */; };
- B21734EE13916FBD00299F09 /* ButtonGitPressed.png in Resources */ = {isa = PBXBuildFile; fileRef = B21734E713916FBD00299F09 /* ButtonGitPressed.png */; };
B21734EF13916FBD00299F09 /* ButtonTerminal.png in Resources */ = {isa = PBXBuildFile; fileRef = B21734E913916FBD00299F09 /* ButtonTerminal.png */; };
B21734F013916FBD00299F09 /* ButtonTerminalPressed.png in Resources */ = {isa = PBXBuildFile; fileRef = B21734EB13916FBD00299F09 /* ButtonTerminalPressed.png */; };
B2B89112121CD28E00AC78F1 /* MDMissingDrawer.m in Sources */ = {isa = PBXBuildFile; fileRef = B2B890FC121CD28D00AC78F1 /* MDMissingDrawer.m */; };
@@ -41,8 +39,6 @@
8D5B49B6048680CD000E48DA /* MissingDrawer.tmplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MissingDrawer.tmplugin; sourceTree = BUILT_PRODUCTS_DIR; };
B21734D613916D0200299F09 /* MDDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MDDefines.h; sourceTree = "<group>"; };
B21734D713916D0200299F09 /* MDDefines.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MDDefines.m; sourceTree = "<group>"; };
- B21734E613916FBD00299F09 /* English */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = English; path = English.lproj/ButtonGit.png; sourceTree = "<group>"; };
- B21734E813916FBD00299F09 /* English */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = English; path = English.lproj/ButtonGitPressed.png; sourceTree = "<group>"; };
B21734EA13916FBD00299F09 /* English */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = English; path = English.lproj/ButtonTerminal.png; sourceTree = "<group>"; };
B21734EC13916FBD00299F09 /* English */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = English; path = English.lproj/ButtonTerminalPressed.png; sourceTree = "<group>"; };
B2B890FB121CD28D00AC78F1 /* MDMissingDrawer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MDMissingDrawer.h; sourceTree = "<group>"; };
@@ -140,8 +136,6 @@
B2B89106121CD28D00AC78F1 /* Resources */ = {
isa = PBXGroup;
children = (
- B21734E513916FBD00299F09 /* ButtonGit.png */,
- B21734E713916FBD00299F09 /* ButtonGitPressed.png */,
B21734E913916FBD00299F09 /* ButtonTerminal.png */,
B21734EB13916FBD00299F09 /* ButtonTerminalPressed.png */,
093EFCA512AFEF0E00D8A18C /* Preferences.xib */,
@@ -258,8 +252,6 @@
B2B89118121CD28E00AC78F1 /* DrawerResizeHandle.png in Resources */,
17A67ED81220168000BECE6F /* defaultSettings.plist in Resources */,
093EFCA712AFEF0E00D8A18C /* Preferences.xib in Resources */,
- B21734ED13916FBD00299F09 /* ButtonGit.png in Resources */,
- B21734EE13916FBD00299F09 /* ButtonGitPressed.png in Resources */,
B21734EF13916FBD00299F09 /* ButtonTerminal.png in Resources */,
B21734F013916FBD00299F09 /* ButtonTerminalPressed.png in Resources */,
);
@@ -296,22 +288,6 @@
name = Preferences.xib;
sourceTree = "<group>";
};
- B21734E513916FBD00299F09 /* ButtonGit.png */ = {
- isa = PBXVariantGroup;
- children = (
- B21734E613916FBD00299F09 /* English */,
- );
- name = ButtonGit.png;
- sourceTree = "<group>";
- };
- B21734E713916FBD00299F09 /* ButtonGitPressed.png */ = {
- isa = PBXVariantGroup;
- children = (
- B21734E813916FBD00299F09 /* English */,
- );
- name = ButtonGitPressed.png;
- sourceTree = "<group>";
- };
B21734E913916FBD00299F09 /* ButtonTerminal.png */ = {
isa = PBXVariantGroup;
children = (
View
3 Other Sources/MDDefines.h
@@ -21,7 +21,4 @@ extern NSString *const kMDTerminalButtonEnabledKey;
extern NSString *const kMDTerminalApplicationKey;
extern NSString *const kMDTerminalOpenTabKey;
-// Git
-extern NSString *const kMDGitButtonEnabledKey;
-
#endif
View
3 Other Sources/MDDefines.m
@@ -19,6 +19,3 @@
NSString *const kMDTerminalButtonEnabledKey = @"MDTerminalButtonEnabled";
NSString *const kMDTerminalApplicationKey = @"MDTerminalApplication";
NSString *const kMDTerminalOpenTabKey = @"MDTerminalOpenTab";
-
-// Git
-NSString *const kMDGitButtonEnabledKey = @"MDGitButtonEnabled";
View
BIN Resources/English.lproj/ButtonGit.png
Deleted file not rendered
View
BIN Resources/English.lproj/ButtonGitPressed.png
Deleted file not rendered
View
116 Resources/English.lproj/Preferences.xib
@@ -12,7 +12,7 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="41"/>
+ <integer value="517"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -53,7 +53,7 @@
<object class="NSTabViewItem" id="926000077">
<string key="NSIdentifier">General</string>
<object class="NSView" key="NSView" id="980884557">
- <reference key="NSNextResponder" ref="520768783"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -193,7 +193,6 @@
</object>
</object>
<string key="NSFrame">{{10, 33}, {402, 248}}</string>
- <reference key="NSSuperview" ref="520768783"/>
</object>
<string key="NSLabel">Sidebar</string>
<reference key="NSColor" ref="646245018"/>
@@ -202,7 +201,7 @@
<object class="NSTabViewItem" id="371939547">
<string key="NSIdentifier">Item 1</string>
<object class="NSView" key="NSView" id="699082563">
- <nil key="NSNextResponder"/>
+ <reference key="NSNextResponder" ref="520768783"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -220,11 +219,11 @@
<reference key="NSControlView" ref="417958924"/>
<int key="NSButtonFlags">1211912703</int>
<int key="NSButtonFlags2">2</int>
- <object class="NSCustomResource" key="NSNormalImage" id="11518815">
+ <object class="NSCustomResource" key="NSNormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">NSSwitch</string>
</object>
- <object class="NSButtonImageSource" key="NSAlternateImage" id="13106247">
+ <object class="NSButtonImageSource" key="NSAlternateImage">
<string key="NSImageName">NSSwitch</string>
</object>
<string key="NSAlternateContents"/>
@@ -249,44 +248,6 @@
<reference key="NSTextColor" ref="1015082757"/>
</object>
</object>
- <object class="NSButton" id="213183491">
- <reference key="NSNextResponder" ref="699082563"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{15, 81}, {172, 18}}</string>
- <reference key="NSSuperview" ref="699082563"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSButtonCell" key="NSCell" id="371019732">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">0</int>
- <string key="NSContents">Enable Git button</string>
- <reference key="NSSupport" ref="62353035"/>
- <reference key="NSControlView" ref="213183491"/>
- <int key="NSButtonFlags">1211912703</int>
- <int key="NSButtonFlags2">2</int>
- <reference key="NSNormalImage" ref="11518815"/>
- <reference key="NSAlternateImage" ref="13106247"/>
- <string key="NSAlternateContents"/>
- <string key="NSKeyEquivalent"/>
- <int key="NSPeriodicDelay">200</int>
- <int key="NSPeriodicInterval">25</int>
- </object>
- </object>
- <object class="NSTextField" id="515243203">
- <reference key="NSNextResponder" ref="699082563"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{14, 42}, {374, 33}}</string>
- <reference key="NSSuperview" ref="699082563"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="721503175">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">272760832</int>
- <string key="NSContents">Pressing the Git button will launch GitX for the current repository. gitk is used if GitX is not installed.</string>
- <reference key="NSSupport" ref="26"/>
- <reference key="NSControlView" ref="515243203"/>
- <reference key="NSBackgroundColor" ref="646245018"/>
- <reference key="NSTextColor" ref="1015082757"/>
- </object>
- </object>
<object class="NSPopUpButton" id="665235037">
<reference key="NSNextResponder" ref="699082563"/>
<int key="NSvFlags">268</int>
@@ -366,20 +327,21 @@
</object>
</object>
<string key="NSFrame">{{10, 33}, {402, 248}}</string>
+ <reference key="NSSuperview" ref="520768783"/>
</object>
<string key="NSLabel">Extras</string>
<reference key="NSColor" ref="646245018"/>
<reference key="NSTabView" ref="520768783"/>
</object>
</object>
- <reference key="NSSelectedTabViewItem" ref="926000077"/>
+ <reference key="NSSelectedTabViewItem" ref="371939547"/>
<reference key="NSFont" ref="62353035"/>
<int key="NSTvFlags">0</int>
<bool key="NSAllowTruncatedLabels">YES</bool>
<bool key="NSDrawsBackground">YES</bool>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="980884557"/>
+ <reference ref="699082563"/>
</object>
</object>
</object>
@@ -483,22 +445,6 @@
<int key="connectionID">547</int>
</object>
<object class="IBConnectionRecord">
- <object class="IBBindingConnection" key="connection">
- <string key="label">value: values.MDGitButtonEnabled</string>
- <reference key="source" ref="213183491"/>
- <reference key="destination" ref="330941994"/>
- <object class="NSNibBindingConnector" key="connector">
- <reference key="NSSource" ref="213183491"/>
- <reference key="NSDestination" ref="330941994"/>
- <string key="NSLabel">value: values.MDGitButtonEnabled</string>
- <string key="NSBinding">value</string>
- <string key="NSKeyPath">values.MDGitButtonEnabled</string>
- <int key="NSNibBindingConnectorVersion">2</int>
- </object>
- </object>
- <int key="connectionID">549</int>
- </object>
- <object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">versionTextField</string>
<reference key="source" ref="1001"/>
@@ -635,8 +581,6 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="417958924"/>
<reference ref="485567724"/>
- <reference ref="213183491"/>
- <reference ref="515243203"/>
<reference ref="513639681"/>
<reference ref="665235037"/>
</object>
@@ -671,34 +615,6 @@
<reference key="parent" ref="485567724"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">524</int>
- <reference key="object" ref="213183491"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="371019732"/>
- </object>
- <reference key="parent" ref="699082563"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">525</int>
- <reference key="object" ref="515243203"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="721503175"/>
- </object>
- <reference key="parent" ref="699082563"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">526</int>
- <reference key="object" ref="721503175"/>
- <reference key="parent" ref="515243203"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">527</int>
- <reference key="object" ref="371019732"/>
- <reference key="parent" ref="213183491"/>
- </object>
- <object class="IBObjectRecord">
<int key="objectID">528</int>
<reference key="object" ref="665235037"/>
<object class="NSMutableArray" key="children">
@@ -810,12 +726,6 @@
<string>522.IBPluginDependency</string>
<string>522.IBViewBoundsToFrameTransform</string>
<string>523.IBPluginDependency</string>
- <string>524.IBPluginDependency</string>
- <string>524.IBViewBoundsToFrameTransform</string>
- <string>525.IBPluginDependency</string>
- <string>525.IBViewBoundsToFrameTransform</string>
- <string>526.IBPluginDependency</string>
- <string>527.IBPluginDependency</string>
<string>528.IBPluginDependency</string>
<string>528.IBViewBoundsToFrameTransform</string>
<string>529.IBPluginDependency</string>
@@ -884,16 +794,6 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
- <bytes key="NSTransformStruct">P4AAAL+AAABBcAAAwuIAAA</bytes>
- </object>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <object class="NSAffineTransform">
- <bytes key="NSTransformStruct">P4AAAL+AAABBYAAAwrIAAA</bytes>
- </object>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <object class="NSAffineTransform">
<bytes key="NSTransformStruct">P4AAAL+AAABDGgAAwyoAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
View
2 Resources/defaultSettings.plist
@@ -18,7 +18,5 @@
<string>Terminal</string>
<key>MDTerminalOpenTab</key>
<true/>
- <key>MDGitButtonEnabled</key>
- <false/>
</dict>
</plist>

2 comments on commit e56b695

@TALlama

Why was the git button removed?

@jezdez

Because Git support (or actually GitX in this case) is frankly not a core feature of TextMate.

Please sign in to comment.