Permalink
Browse files

added button for copying gist url

  • Loading branch information...
1 parent af0c23a commit e697ce43552bf8df2c02d1ba5e464231c33842c3 Greg Borenstein committed Apr 11, 2010
@@ -2,13 +2,13 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.03">
<data>
<int key="IBDocument.SystemTarget">1050</int>
- <string key="IBDocument.SystemVersion">9J3050</string>
+ <string key="IBDocument.SystemVersion">9L31a</string>
<string key="IBDocument.InterfaceBuilderVersion">677</string>
- <string key="IBDocument.AppKitVersion">949.46</string>
+ <string key="IBDocument.AppKitVersion">949.54</string>
<string key="IBDocument.HIToolboxVersion">353.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="100087"/>
+ <integer value="100076"/>
<integer value="100036"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
@@ -415,7 +415,7 @@
<nil key="NSDelegate"/>
</object>
</object>
- <string key="NSFrame">{{1, 1}, {594, 717}}</string>
+ <string key="NSFrame">{{1, 1}, {594, 657}}</string>
<reference key="NSSuperview" ref="183766710"/>
<reference key="NSNextKeyView" ref="711664853"/>
<reference key="NSDocView" ref="711664853"/>
@@ -429,7 +429,7 @@
<object class="NSScroller" id="501219584">
<reference key="NSNextResponder" ref="183766710"/>
<int key="NSvFlags">256</int>
- <string key="NSFrame">{{595, 1}, {15, 703}}</string>
+ <string key="NSFrame">{{595, 1}, {15, 643}}</string>
<reference key="NSSuperview" ref="183766710"/>
<reference key="NSTarget" ref="183766710"/>
<string key="NSAction">_doScroller:</string>
@@ -447,14 +447,38 @@
<double key="NSPercent">9.456522e-01</double>
</object>
</object>
- <string key="NSFrameSize">{611, 719}</string>
+ <string key="NSFrameSize">{611, 659}</string>
<reference key="NSSuperview" ref="645507211"/>
<reference key="NSNextKeyView" ref="561630725"/>
<int key="NSsFlags">18</int>
<reference key="NSVScroller" ref="501219584"/>
<reference key="NSHScroller" ref="600053430"/>
<reference key="NSContentView" ref="561630725"/>
</object>
+ <object class="NSButton" id="643905025">
+ <reference key="NSNextResponder" ref="645507211"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{4, 663}, {49, 50}}</string>
+ <reference key="NSSuperview" ref="645507211"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="539431517">
+ <int key="NSCellFlags">-2080244224</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents">url</string>
+ <object class="NSFont" key="NSSupport">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">1.000000e+01</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <reference key="NSControlView" ref="643905025"/>
+ <int key="NSButtonFlags">-2033434369</int>
+ <int key="NSButtonFlags2">130</int>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">400</int>
+ <int key="NSPeriodicInterval">75</int>
+ </object>
+ </object>
</object>
<string key="NSFrame">{{219, 0}, {611, 719}}</string>
<reference key="NSSuperview" ref="195632884"/>
@@ -791,6 +815,22 @@
</object>
<int key="connectionID">100093</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">gist_url_copy_button</string>
+ <reference key="source" ref="512844837"/>
+ <reference key="destination" ref="643905025"/>
+ </object>
+ <int key="connectionID">100096</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">copyCurrentGistUrl:</string>
+ <reference key="source" ref="512844837"/>
+ <reference key="destination" ref="643905025"/>
+ </object>
+ <int key="connectionID">100097</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -953,6 +993,7 @@
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="183766710"/>
+ <reference ref="643905025"/>
</object>
<reference key="parent" ref="195632884"/>
</object>
@@ -1086,6 +1127,20 @@
<reference key="object" ref="865068654"/>
<reference key="parent" ref="356201246"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100094</int>
+ <reference key="object" ref="643905025"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="539431517"/>
+ </object>
+ <reference key="parent" ref="645507211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100095</int>
+ <reference key="object" ref="539431517"/>
+ <reference key="parent" ref="643905025"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -1117,6 +1172,7 @@
<string>100057.IBPluginDependency</string>
<string>100058.IBPluginDependency</string>
<string>100059.IBPluginDependency</string>
+ <string>100060.CustomClassName</string>
<string>100060.IBPluginDependency</string>
<string>100061.IBPluginDependency</string>
<string>100062.IBPluginDependency</string>
@@ -1131,6 +1187,8 @@
<string>100087.IBPluginDependency</string>
<string>100091.IBPluginDependency</string>
<string>100092.IBPluginDependency</string>
+ <string>100094.IBPluginDependency</string>
+ <string>100095.IBPluginDependency</string>
<string>5.IBEditorWindowLastContentRect</string>
<string>5.IBWindowTemplateEditedContentRect</string>
<string>5.ImportedFromIB2</string>
@@ -1149,9 +1207,9 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{189, 446}, {480, 152}}</string>
+ <string>{{246, 380}, {480, 152}}</string>
<boolean value="YES"/>
- <string>{{189, 446}, {480, 152}}</string>
+ <string>{{246, 380}, {480, 152}}</string>
<boolean value="NO"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -1167,6 +1225,7 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>GEGistListTableView</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -1181,8 +1240,10 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{49, 12}, {830, 719}}</string>
- <string>{{49, 12}, {830, 719}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{53, 37}, {830, 719}}</string>
+ <string>{{53, 37}, {830, 719}}</string>
<reference ref="9"/>
<string>{{201, 387}, {507, 413}}</string>
<reference ref="9"/>
@@ -1211,62 +1272,23 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">100093</int>
+ <int key="maxID">100097</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">GEDocument</string>
- <string key="superclassName">NSDocument</string>
<object class="NSMutableDictionary" key="actions">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMutableArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>actuallySendGist:</string>
- <string>captureGistTitleName:</string>
- <string>hideSaveDialog:</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- </object>
- </object>
- <object class="NSMutableDictionary" key="outlets">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMutableArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>associated_library</string>
- <string>current_gist</string>
- <string>gist_title</string>
- <string>gist_title_window</string>
- <string>text_view</string>
- <string>view_contents</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- </object>
- </object>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBProjectSource</string>
- <string key="minorKey">GEDocument.rb</string>
+ <string key="NS.key.0">copyCurrentGistUrl:</string>
+ <string key="NS.object.0">id</string>
</object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">GEDocument</string>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSMutableArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>gistListScrollView</string>
+ <string>gist_url_copy_button</string>
<string>octocatView</string>
<string>progressBar</string>
<string>progressDescription</string>
@@ -1279,6 +1301,7 @@
<string>id</string>
<string>id</string>
<string>id</string>
+ <string>id</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
@@ -1287,15 +1310,11 @@
</object>
</object>
<object class="IBPartialClassDescription">
- <string key="className">GEGistListDelegate</string>
- <string key="superclassName">NSObject</string>
- <object class="NSMutableDictionary" key="outlets">
- <string key="NS.key.0">associatedDocument</string>
- <string key="NS.object.0">id</string>
- </object>
+ <string key="className">GEGistListTableView</string>
+ <string key="superclassName">NSTableView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
- <string key="minorKey">GEGistListDelegate.rb</string>
+ <string key="minorKey">GEGistListTableView.rb</string>
</object>
</object>
<object class="IBPartialClassDescription">
View
@@ -19,12 +19,15 @@ class GEDocument < NSDocument
attr_accessor :gistListScrollView
attr_accessor :octocatView
+ attr_accessor :gist_url_copy_button
+
def applicationDidFinishLaunching(notification)
# pass
end
def windowControllerDidLoadNib(windowController)
self.octocatView.setImage(GEDocument.octocat_happy)
+ self.gist_url_copy_button.setImage(GEDocument.copy_gist_url_button_image)
end
def textDidChange(notification)
@@ -35,6 +38,20 @@ def self.octocat_happy
@@octocat_happy ||= NSImage.alloc.initWithContentsOfFile(NSBundle.mainBundle.pathForImageResource("octocat_happy"))
end
+ def self.copy_gist_url_button_image
+ @@copy_gist_url_button_image ||= NSImage.alloc.initWithContentsOfFile(NSBundle.mainBundle.pathForImageResource("comment_48.png"))
+ end
+
+ def copyCurrentGistUrl(sender)
+ copy_gist_url(current_gist)
+ end
+
+ def copy_gist_url(aGist)
+ if aGist
+ `echo "http://gist.github.com/#{aGist.gist_id}" | pbcopy`
+ end
+ end
+
def octocat_happy
@octocat_happy ||= GEDocument.octocat_happy
end
View
@@ -0,0 +1,20 @@
+#
+# GEGistListTableView.rb
+# gisteditor
+#
+# Created by Greg Borenstein on 4/11/10.
+# Copyright (c) 2010 __MyCompanyName__. All rights reserved.
+#
+
+class GEGistListTableView < NSTableView
+ attr_accessor :the_menu
+
+ def menuForEvent(theEvent)
+ NSLog("here?")
+ @the_menu ||= NSMenu.alloc.initWithTitle("Gist Action Menu")
+ end
+
+ def rightMouseDown(theEvent)
+ NSLog("right mouse")
+ end
+end
Binary file not shown.
@@ -19,12 +19,15 @@ class GEDocument < NSDocument
attr_accessor :gistListScrollView
attr_accessor :octocatView
+ attr_accessor :gist_url_copy_button
+
def applicationDidFinishLaunching(notification)
# pass
end
def windowControllerDidLoadNib(windowController)
self.octocatView.setImage(GEDocument.octocat_happy)
+ self.gist_url_copy_button.setImage(GEDocument.copy_gist_url_button_image)
end
def textDidChange(notification)
@@ -35,6 +38,20 @@ def self.octocat_happy
@@octocat_happy ||= NSImage.alloc.initWithContentsOfFile(NSBundle.mainBundle.pathForImageResource("octocat_happy"))
end
+ def self.copy_gist_url_button_image
+ @@copy_gist_url_button_image ||= NSImage.alloc.initWithContentsOfFile(NSBundle.mainBundle.pathForImageResource("comment_48.png"))
+ end
+
+ def copyCurrentGistUrl(sender)
+ copy_gist_url(current_gist)
+ end
+
+ def copy_gist_url(aGist)
+ if aGist
+ `echo "http://gist.github.com/#{aGist.gist_id}" | pbcopy`
+ end
+ end
+
def octocat_happy
@octocat_happy ||= GEDocument.octocat_happy
end
@@ -6,7 +6,7 @@
# Copyright (c) 2009 __MyCompanyName__. All rights reserved.
#
-class GEGistListDelegate < NSResponder
+class GEGistListDelegate
attr_accessor :associatedDocument
def awakeFromNib()
@@ -16,10 +16,6 @@ def numberOfRowsInTableView(aTableView)
@library = GEGistLibrary.new
@library.gists.length
end
-
- def rightMouseDown(theEvent)
- NSLog("right mouse")
- end
def tableViewSelectionDidChange(notification)
gist = GEGist.new(associatedDocument.library.gistsSortedByName[notification.object.selectedRow])
Oops, something went wrong.

0 comments on commit e697ce4

Please sign in to comment.