Permalink
Browse files

preference dialog window for GH credentials; use the prefs in posting

  • Loading branch information...
1 parent af01956 commit 1c0f1034273a38e6befbc79949b3ebaba7517de6 Greg Borenstein committed Aug 4, 2009
View
@@ -1120,7 +1120,7 @@
<object class="NSWindowTemplate" id="842391767">
<int key="NSWindowStyleMask">15</int>
<int key="NSWindowBacking">2</int>
- <string key="NSWindowRect">{{196, 374}, {325, 136}}</string>
+ <string key="NSWindowRect">{{196, 374}, {423, 136}}</string>
<int key="NSWTFlags">-469762048</int>
<string key="NSWindowTitle">Drift Preferences</string>
<string key="NSWindowClass">NSPanel</string>
@@ -1186,7 +1186,7 @@
<object class="NSTextField" id="24158720">
<reference key="NSNextResponder" ref="185651455"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{114, 94}, {191, 22}}</string>
+ <string key="NSFrame">{{114, 94}, {289, 22}}</string>
<reference key="NSSuperview" ref="185651455"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="423032661">
@@ -1216,7 +1216,7 @@
<object class="NSButton" id="571199902">
<reference key="NSNextResponder" ref="185651455"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{204, 12}, {107, 32}}</string>
+ <string key="NSFrame">{{302, 12}, {107, 32}}</string>
<reference key="NSSuperview" ref="185651455"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="691801534">
@@ -1236,7 +1236,7 @@
<object class="NSButton" id="904533372">
<reference key="NSNextResponder" ref="185651455"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{108, 12}, {96, 32}}</string>
+ <string key="NSFrame">{{206, 12}, {96, 32}}</string>
<reference key="NSSuperview" ref="185651455"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="36669582">
@@ -1253,30 +1253,33 @@
<int key="NSPeriodicInterval">25</int>
</object>
</object>
- <object class="NSTextField" id="437462703">
+ <object class="NSTextField" id="465825811">
<reference key="NSNextResponder" ref="185651455"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{114, 63}, {191, 22}}</string>
+ <string key="NSFrame">{{114, 63}, {289, 22}}</string>
<reference key="NSSuperview" ref="185651455"/>
<bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="649074460">
+ <object class="NSTextFieldCell" key="NSCell" id="644816475">
<int key="NSCellFlags">-1804468671</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents"/>
<reference key="NSSupport" ref="33701594"/>
- <reference key="NSControlView" ref="437462703"/>
+ <reference key="NSControlView" ref="465825811"/>
<bool key="NSDrawsBackground">YES</bool>
<reference key="NSBackgroundColor" ref="481285003"/>
<reference key="NSTextColor" ref="265117093"/>
</object>
</object>
</object>
- <string key="NSFrameSize">{325, 136}</string>
+ <string key="NSFrameSize">{423, 136}</string>
<reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1280, 778}}</string>
<string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
</object>
+ <object class="NSCustomObject" id="507306431">
+ <string key="NSClassName">GEPrefWindowController</string>
+ </object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
@@ -1825,6 +1828,38 @@
</object>
<int key="connectionID">500</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">setPreferences:</string>
+ <reference key="source" ref="507306431"/>
+ <reference key="destination" ref="571199902"/>
+ </object>
+ <int key="connectionID">502</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">gh_LoginField</string>
+ <reference key="source" ref="507306431"/>
+ <reference key="destination" ref="24158720"/>
+ </object>
+ <int key="connectionID">505</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">gh_TokenField</string>
+ <reference key="source" ref="507306431"/>
+ <reference key="destination" ref="465825811"/>
+ </object>
+ <int key="connectionID">506</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">performClose:</string>
+ <reference key="source" ref="842391767"/>
+ <reference key="destination" ref="904533372"/>
+ </object>
+ <int key="connectionID">507</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -2729,9 +2764,9 @@
<reference ref="24158720"/>
<reference ref="48481478"/>
<reference ref="1024745292"/>
- <reference ref="904533372"/>
+ <reference ref="465825811"/>
<reference ref="571199902"/>
- <reference ref="437462703"/>
+ <reference ref="904533372"/>
</object>
<reference key="parent" ref="842391767"/>
</object>
@@ -2807,17 +2842,22 @@
</object>
<object class="IBObjectRecord">
<int key="objectID">496</int>
- <reference key="object" ref="437462703"/>
+ <reference key="object" ref="465825811"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="649074460"/>
+ <reference ref="644816475"/>
</object>
<reference key="parent" ref="185651455"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">497</int>
- <reference key="object" ref="649074460"/>
- <reference key="parent" ref="437462703"/>
+ <reference key="object" ref="644816475"/>
+ <reference key="parent" ref="465825811"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">501</int>
+ <reference key="object" ref="507306431"/>
+ <reference key="parent" ref="1049"/>
</object>
</object>
</object>
@@ -3027,6 +3067,7 @@
<string>497.IBPluginDependency</string>
<string>5.IBPluginDependency</string>
<string>5.ImportedFromIB2</string>
+ <string>501.IBPluginDependency</string>
<string>56.IBPluginDependency</string>
<string>56.ImportedFromIB2</string>
<string>57.IBEditorWindowLastContentRect</string>
@@ -3248,8 +3289,8 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{249, 61}, {325, 136}}</string>
- <string>{{249, 61}, {325, 136}}</string>
+ <string>{{74, 479}, {423, 136}}</string>
+ <string>{{74, 479}, {423, 136}}</string>
<boolean value="NO"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -3267,6 +3308,7 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>{{209, 485}, {210, 183}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -3322,7 +3364,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">500</int>
+ <int key="maxID">507</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -3334,6 +3376,30 @@
<string key="minorKey"/>
</object>
</object>
+ <object class="IBPartialClassDescription">
+ <string key="className">GEPrefWindowController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">setPreferences:</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>gh_LoginField</string>
+ <string>gh_TokenField</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBUserSource</string>
+ <string key="minorKey"/>
+ </object>
+ </object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
View
@@ -39,7 +39,7 @@ def save(menuItem)
end
def postGist(gist_content, filename)
- post = "files[#{filename}]=#{gist_content}&login=atduskgreg&token=1d84af3a6008854ade82ec7d242e7b3a"
+ post = "files[#{filename}]=#{gist_content}&login=#{preferences.user.login}&token=#{preferences.user.token}"
postData = post.dataUsingEncoding(NSASCIIStringEncoding,
allowLossyConversion:true)
postLength = NSString.stringWithFormat("%d", postData.length)
View
@@ -8,7 +8,18 @@
class GEPrefWindowController
attr_accessor :preferencesWindow
+ attr_accessor :gh_LoginField
+ attr_accessor :gh_TokenField
+
+ def awakeFromNib()
+ gh_LoginField.stringValue = preferences.user.login
+ gh_TokenField.stringValue = preferences.user.token
+ end
def setPreferences(sender)
+ preferences.user.login = gh_LoginField.stringValue
+ preferences.user.token = gh_TokenField.stringValue
+ sender.window.close()
end
+
end
@@ -39,7 +39,7 @@ def save(menuItem)
end
def postGist(gist_content, filename)
- post = "files[#{filename}]=#{gist_content}&login=atduskgreg&token=1d84af3a6008854ade82ec7d242e7b3a"
+ post = "files[#{filename}]=#{gist_content}&login=#{preferences.user.login}&token=#{preferences.user.token}"
postData = post.dataUsingEncoding(NSASCIIStringEncoding,
allowLossyConversion:true)
postLength = NSString.stringWithFormat("%d", postData.length)
@@ -8,7 +8,18 @@
class GEPrefWindowController
attr_accessor :preferencesWindow
+ attr_accessor :gh_LoginField
+ attr_accessor :gh_TokenField
+
+ def awakeFromNib()
+ gh_LoginField.stringValue = preferences.user.login
+ gh_TokenField.stringValue = preferences.user.token
+ end
def setPreferences(sender)
+ preferences.user.login = gh_LoginField.stringValue
+ preferences.user.token = gh_TokenField.stringValue
+ sender.window.close()
end
+
end
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -333,20 +333,20 @@
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>3777126B1028F6670027C60B</string>
+ <string>377712B51028FCAF0027C60B</string>
<key>history</key>
<array>
<string>37902CD30FD6F6F100DE3FDE</string>
<string>37902CD50FD6F6F100DE3FDE</string>
<string>379576080FF5FAF700B4A97E</string>
<string>3777122F1028F4A10027C60B</string>
- <string>377712301028F4A10027C60B</string>
- <string>377712311028F4A10027C60B</string>
- <string>377712321028F4A10027C60B</string>
- <string>377712331028F4A10027C60B</string>
- <string>377712341028F4A10027C60B</string>
<string>377712351028F4A10027C60B</string>
- <string>377712361028F4A10027C60B</string>
+ <string>377712811028FA3D0027C60B</string>
+ <string>377712941028FB110027C60B</string>
+ <string>377712961028FB110027C60B</string>
+ <string>377712A41028FBE60027C60B</string>
+ <string>377712B11028FC9B0027C60B</string>
+ <string>377712B21028FC9B0027C60B</string>
</array>
<key>prevStack</key>
<array>
@@ -398,6 +398,29 @@
<string>377712591028F4A10027C60B</string>
<string>3777125A1028F4A10027C60B</string>
<string>3777125B1028F4A10027C60B</string>
+ <string>3777126F1028F76D0027C60B</string>
+ <string>377712751028F83D0027C60B</string>
+ <string>377712761028F83D0027C60B</string>
+ <string>377712771028F83D0027C60B</string>
+ <string>377712781028F83D0027C60B</string>
+ <string>377712791028F83D0027C60B</string>
+ <string>377712851028FA3D0027C60B</string>
+ <string>377712861028FA3D0027C60B</string>
+ <string>377712871028FA3D0027C60B</string>
+ <string>377712881028FA3D0027C60B</string>
+ <string>377712891028FA3D0027C60B</string>
+ <string>3777128A1028FA3D0027C60B</string>
+ <string>377712901028FA940027C60B</string>
+ <string>377712911028FA940027C60B</string>
+ <string>377712981028FB110027C60B</string>
+ <string>377712991028FB110027C60B</string>
+ <string>3777129A1028FB110027C60B</string>
+ <string>3777129B1028FB110027C60B</string>
+ <string>3777129C1028FB110027C60B</string>
+ <string>377712A11028FB6C0027C60B</string>
+ <string>377712A51028FBE60027C60B</string>
+ <string>377712A61028FBE60027C60B</string>
+ <string>377712B31028FC9B0027C60B</string>
</array>
</dict>
<key>SplitCount</key>
Oops, something went wrong.

0 comments on commit 1c0f103

Please sign in to comment.