Permalink
Browse files

Make the share button work

Add a spinner animation to give good feedback to the process
  • Loading branch information...
1 parent 097cee3 commit bd4d1b935f34bb42ad2fcb446ee5d91da6a65e47 @mxcl committed Jul 14, 2009
Showing with 50 additions and 12 deletions.
  1. +46 −11 ShareWindow.xib
  2. +1 −0 StatusItemController.h
  3. +3 −0 StatusItemController.m
  4. +0 −1 dist.sh
View
@@ -8,7 +8,7 @@
<string key="IBDocument.HIToolboxVersion">353.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="2"/>
+ <integer value="28"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -146,6 +146,16 @@
<int key="NSPeriodicInterval">25</int>
</object>
</object>
+ <object class="NSProgressIndicator" id="702330352">
+ <reference key="NSNextResponder" ref="1006"/>
+ <int key="NSvFlags">1292</int>
+ <object class="NSPSMatrix" key="NSDrawMatrix"/>
+ <string key="NSFrame">{{175, 22}, {16, 16}}</string>
+ <reference key="NSSuperview" ref="1006"/>
+ <int key="NSpiFlags">28938</int>
+ <double key="NSMinValue">1.600000e+01</double>
+ <double key="NSMaxValue">1.000000e+02</double>
+ </object>
</object>
<string key="NSFrameSize">{303, 102}</string>
<reference key="NSSuperview"/>
@@ -175,19 +185,27 @@
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
- <string key="label">orderOut:</string>
+ <string key="label">performClose:</string>
<reference key="source" ref="1005"/>
- <reference key="destination" ref="780453229"/>
+ <reference key="destination" ref="598622801"/>
</object>
- <int key="connectionID">23</int>
+ <int key="connectionID">26</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
- <string key="label">performClose:</string>
- <reference key="source" ref="1005"/>
- <reference key="destination" ref="598622801"/>
+ <string key="label">submit:</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="780453229"/>
</object>
- <int key="connectionID">26</int>
+ <int key="connectionID">27</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">spinner</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="702330352"/>
+ </object>
+ <int key="connectionID">29</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
@@ -237,6 +255,7 @@
<reference ref="805260398"/>
<reference ref="330731467"/>
<reference ref="598622801"/>
+ <reference ref="702330352"/>
</object>
<reference key="parent" ref="1005"/>
</object>
@@ -296,6 +315,11 @@
<reference key="object" ref="195580423"/>
<reference key="parent" ref="598622801"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">28</int>
+ <reference key="object" ref="702330352"/>
+ <reference key="parent" ref="1006"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -322,6 +346,7 @@
<string>2.IBPluginDependency</string>
<string>24.IBPluginDependency</string>
<string>25.IBPluginDependency</string>
+ <string>28.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -345,6 +370,7 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
@@ -367,7 +393,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">26</int>
+ <int key="maxID">29</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -380,8 +406,17 @@
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="outlets">
- <string key="NS.key.0">username</string>
- <string key="NS.object.0">NSTextField</string>
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>spinner</string>
+ <string>username</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>NSProgressIndicator</string>
+ <string>NSTextField</string>
+ </object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
@@ -46,6 +46,7 @@
@interface ShareWindowController:NSWindowController
{
+ IBOutlet NSProgressIndicator* spinner;
IBOutlet NSTextField* username;
}
-(IBAction)submit:(id)sender;
@@ -330,7 +330,10 @@ @implementation ShareWindowController
-(void)submit:(id)sender
{
+ [spinner startAnimation:self];
[lastfm share:[[Mediator sharedMediator] currentTrack] with:[username stringValue]];
+ [self close];
+ [spinner stopAnimation:self];
}
-(void)showWindow:(id)sender
View
@@ -1,5 +1,4 @@
rm -r build
xcodebuild -configuration Release -project Audioscrobbler.xcodeproj || exit $?
open build/Release
-hdiutil create -srcfolder build/Release/Audioscrobbler.app -format UDZO -imagekey zlib-level=9 -scrub Audioscrobbler.dmg

0 comments on commit bd4d1b9

Please sign in to comment.