Browse Source

Local Network: add visual feedback when starting downloads

Felix Paul Kühne 12 years ago
parent
commit
35e501db45

+ 3 - 0
AspenProject/VLCLocalNetworkListCell.h

@@ -10,6 +10,8 @@
 
 #import <UIKit/UIKit.h>
 
+@class VLCStatusLabel;
+
 @interface VLCLocalNetworkListCell : UITableViewCell
 
 @property (nonatomic, weak) id delegate;
@@ -19,6 +21,7 @@
 @property (nonatomic, strong) IBOutlet UILabel *subtitleLabel;
 @property (nonatomic, strong) IBOutlet UIImageView *thumbnailView;
 @property (nonatomic, strong) IBOutlet UIButton *downloadButton;
+@property (nonatomic, strong) IBOutlet VLCStatusLabel *statusLabel;
 
 @property (nonatomic, readwrite) BOOL isDirectory;
 @property (nonatomic, retain) NSString *title;

+ 4 - 1
AspenProject/VLCLocalServerFolderListViewController.m

@@ -20,6 +20,7 @@
 #import "VLCDownloadViewController.h"
 #import "WhiteRaccoon.h"
 #import "NSString+SupportedMedia.h"
+#import "VLCStatusLabel.h"
 
 #define kVLCUPNPFileServer 0
 #define kVLCFTPServer 1
@@ -308,8 +309,10 @@
         if (![objectName isSupportedFormat]) {
             UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"FILE_NOT_SUPPORTED", @"") message:[NSString stringWithFormat:NSLocalizedString(@"FILE_NOT_SUPPORTED_LONG", @""), objectName] delegate:self cancelButtonTitle:NSLocalizedString(@"BUTTON_CANCEL", @"") otherButtonTitles:nil];
             [alert show];
-        } else
+        } else {
             [self _downloadFTPFile:objectName];
+            [cell.statusLabel showStatusMessage:NSLocalizedString(@"DOWNLOADING", @"")];
+        }
     }
 }
 

+ 60 - 3
Resources/VLCLocalNetworkListCell~ipad.xib

@@ -2,7 +2,7 @@
 <archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
 	<data>
 		<int key="IBDocument.SystemTarget">1296</int>
-		<string key="IBDocument.SystemVersion">12F33</string>
+		<string key="IBDocument.SystemVersion">12F36</string>
 		<string key="IBDocument.InterfaceBuilderVersion">3084</string>
 		<string key="IBDocument.AppKitVersion">1187.39</string>
 		<string key="IBDocument.HIToolboxVersion">626.00</string>
@@ -89,7 +89,7 @@
 								<string key="NSFrame">{{83, 29}, {232, 21}}</string>
 								<reference key="NSSuperview" ref="162418872"/>
 								<reference key="NSWindow"/>
-								<reference key="NSNextKeyView" ref="625431089"/>
+								<reference key="NSNextKeyView" ref="350446581"/>
 								<string key="NSReuseIdentifierKey">_NS:9</string>
 								<bool key="IBUIOpaque">NO</bool>
 								<bool key="IBUIClipsSubviews">YES</bool>
@@ -144,6 +144,7 @@
 								<string key="NSFrame">{{268, 24}, {32, 32}}</string>
 								<reference key="NSSuperview" ref="162418872"/>
 								<reference key="NSWindow"/>
+								<reference key="NSNextKeyView"/>
 								<string key="NSReuseIdentifierKey">_NS:9</string>
 								<bool key="IBUIOpaque">NO</bool>
 								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
@@ -172,6 +173,33 @@
 									<int key="NSfFlags">16</int>
 								</object>
 							</object>
+							<object class="IBUILabel" id="350446581">
+								<reference key="NSNextResponder" ref="162418872"/>
+								<int key="NSvFlags">-2147483358</int>
+								<string key="NSFrame">{{83, 29}, {177, 21}}</string>
+								<reference key="NSSuperview" ref="162418872"/>
+								<reference key="NSWindow"/>
+								<reference key="NSNextKeyView" ref="625431089"/>
+								<string key="NSReuseIdentifierKey">_NS:9</string>
+								<bool key="IBUIOpaque">NO</bool>
+								<bool key="IBUIClipsSubviews">YES</bool>
+								<int key="IBUIContentMode">7</int>
+								<bool key="IBUIUserInteractionEnabled">NO</bool>
+								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+								<string key="IBUIText">Downloading...</string>
+								<object class="NSColor" key="IBUITextColor">
+									<int key="NSColorSpace">1</int>
+									<bytes key="NSRGB">MSAxIDEAA</bytes>
+									<object class="NSColorSpace" key="NSCustomColorSpace">
+										<int key="NSID">1</int>
+									</object>
+								</object>
+								<reference key="IBUIHighlightedColor" ref="654385816"/>
+								<int key="IBUIBaselineAdjustment">0</int>
+								<reference key="IBUIFontDescription" ref="123705061"/>
+								<reference key="IBUIFont" ref="458645332"/>
+								<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
+							</object>
 						</array>
 						<string key="NSFrameSize">{320, 79}</string>
 						<reference key="NSSuperview" ref="962619467"/>
@@ -247,6 +275,14 @@
 					<int key="connectionID">26</int>
 				</object>
 				<object class="IBConnectionRecord">
+					<object class="IBCocoaTouchOutletConnection" key="connection">
+						<string key="label">statusLabel</string>
+						<reference key="source" ref="962619467"/>
+						<reference key="destination" ref="350446581"/>
+					</object>
+					<int key="connectionID">29</int>
+				</object>
+				<object class="IBConnectionRecord">
 					<object class="IBCocoaTouchEventConnection" key="connection">
 						<string key="label">triggerDownload:</string>
 						<reference key="source" ref="167761471"/>
@@ -284,6 +320,7 @@
 							<reference ref="625431089"/>
 							<reference ref="1019407525"/>
 							<reference ref="167761471"/>
+							<reference ref="350446581"/>
 						</array>
 						<reference key="parent" ref="0"/>
 					</object>
@@ -312,6 +349,11 @@
 						<reference key="object" ref="167761471"/>
 						<reference key="parent" ref="962619467"/>
 					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">28</int>
+						<reference key="object" ref="350446581"/>
+						<reference key="parent" ref="962619467"/>
+					</object>
 				</array>
 			</object>
 			<dictionary class="NSMutableDictionary" key="flattenedProperties">
@@ -320,6 +362,8 @@
 				<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 				<string key="23.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 				<string key="25.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+				<string key="28.CustomClassName">VLCStatusLabel</string>
+				<string key="28.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 				<string key="3.CustomClassName">VLCLocalNetworkListCell</string>
 				<string key="3.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 				<string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@@ -330,7 +374,7 @@
 			<nil key="activeLocalization"/>
 			<dictionary class="NSMutableDictionary" key="localizations"/>
 			<nil key="sourceID"/>
-			<int key="maxID">27</int>
+			<int key="maxID">29</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<array class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -351,6 +395,7 @@
 					<dictionary class="NSMutableDictionary" key="outlets">
 						<string key="downloadButton">UIButton</string>
 						<string key="folderTitleLabel">UILabel</string>
+						<string key="statusLabel">VLCStatusLabel</string>
 						<string key="subtitleLabel">UILabel</string>
 						<string key="thumbnailView">UIImageView</string>
 						<string key="titleLabel">UILabel</string>
@@ -364,6 +409,10 @@
 							<string key="name">folderTitleLabel</string>
 							<string key="candidateClassName">UILabel</string>
 						</object>
+						<object class="IBToOneOutletInfo" key="statusLabel">
+							<string key="name">statusLabel</string>
+							<string key="candidateClassName">VLCStatusLabel</string>
+						</object>
 						<object class="IBToOneOutletInfo" key="subtitleLabel">
 							<string key="name">subtitleLabel</string>
 							<string key="candidateClassName">UILabel</string>
@@ -382,6 +431,14 @@
 						<string key="minorKey">./Classes/VLCLocalNetworkListCell.h</string>
 					</object>
 				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">VLCStatusLabel</string>
+					<string key="superclassName">UILabel</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">./Classes/VLCStatusLabel.h</string>
+					</object>
+				</object>
 			</array>
 		</object>
 		<int key="IBDocument.localizationMode">0</int>

+ 55 - 3
Resources/VLCLocalNetworkListCell~iphone.xib

@@ -2,7 +2,7 @@
 <archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
 	<data>
 		<int key="IBDocument.SystemTarget">1296</int>
-		<string key="IBDocument.SystemVersion">12F33</string>
+		<string key="IBDocument.SystemVersion">12F36</string>
 		<string key="IBDocument.InterfaceBuilderVersion">3084</string>
 		<string key="IBDocument.AppKitVersion">1187.39</string>
 		<string key="IBDocument.HIToolboxVersion">626.00</string>
@@ -89,7 +89,7 @@
 								<string key="NSFrame">{{45, 14}, {270, 18}}</string>
 								<reference key="NSSuperview" ref="162418872"/>
 								<reference key="NSWindow"/>
-								<reference key="NSNextKeyView" ref="625431089"/>
+								<reference key="NSNextKeyView" ref="534678465"/>
 								<string key="NSReuseIdentifierKey">_NS:9</string>
 								<bool key="IBUIOpaque">NO</bool>
 								<bool key="IBUIClipsSubviews">YES</bool>
@@ -104,12 +104,34 @@
 								<reference key="IBUIFont" ref="7653884"/>
 								<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
 							</object>
+							<object class="IBUILabel" id="534678465">
+								<reference key="NSNextResponder" ref="162418872"/>
+								<int key="NSvFlags">-2147483358</int>
+								<string key="NSFrame">{{45, 14}, {270, 18}}</string>
+								<reference key="NSSuperview" ref="162418872"/>
+								<reference key="NSWindow"/>
+								<reference key="NSNextKeyView" ref="625431089"/>
+								<string key="NSReuseIdentifierKey">_NS:9</string>
+								<bool key="IBUIOpaque">NO</bool>
+								<bool key="IBUIClipsSubviews">YES</bool>
+								<int key="IBUIContentMode">7</int>
+								<bool key="IBUIUserInteractionEnabled">NO</bool>
+								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+								<string key="IBUIText">Downloading...</string>
+								<reference key="IBUITextColor" ref="654385816"/>
+								<reference key="IBUIHighlightedColor" ref="654385816"/>
+								<int key="IBUILineBreakMode">0</int>
+								<reference key="IBUIFontDescription" ref="868609050"/>
+								<reference key="IBUIFont" ref="7653884"/>
+								<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
+							</object>
 							<object class="IBUILabel" id="625431089">
 								<reference key="NSNextResponder" ref="162418872"/>
 								<int key="NSvFlags">266</int>
 								<string key="NSFrame">{{45, 26}, {237, 15}}</string>
 								<reference key="NSSuperview" ref="162418872"/>
 								<reference key="NSWindow"/>
+								<reference key="NSNextKeyView" ref="152553733"/>
 								<string key="NSReuseIdentifierKey">_NS:9</string>
 								<bool key="IBUIOpaque">NO</bool>
 								<bool key="IBUIClipsSubviews">YES</bool>
@@ -141,6 +163,7 @@
 								<string key="NSFrame">{{283, 7}, {32, 32}}</string>
 								<reference key="NSSuperview" ref="162418872"/>
 								<reference key="NSWindow"/>
+								<reference key="NSNextKeyView"/>
 								<string key="NSReuseIdentifierKey">_NS:9</string>
 								<bool key="IBUIOpaque">NO</bool>
 								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
@@ -244,6 +267,14 @@
 					<int key="connectionID">27</int>
 				</object>
 				<object class="IBConnectionRecord">
+					<object class="IBCocoaTouchOutletConnection" key="connection">
+						<string key="label">statusLabel</string>
+						<reference key="source" ref="962619467"/>
+						<reference key="destination" ref="534678465"/>
+					</object>
+					<int key="connectionID">29</int>
+				</object>
+				<object class="IBConnectionRecord">
 					<object class="IBCocoaTouchEventConnection" key="connection">
 						<string key="label">triggerDownload:</string>
 						<reference key="source" ref="152553733"/>
@@ -281,6 +312,7 @@
 							<reference ref="625431089"/>
 							<reference ref="816829197"/>
 							<reference ref="152553733"/>
+							<reference ref="534678465"/>
 						</array>
 						<reference key="parent" ref="0"/>
 					</object>
@@ -309,6 +341,11 @@
 						<reference key="object" ref="152553733"/>
 						<reference key="parent" ref="962619467"/>
 					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">28</int>
+						<reference key="object" ref="534678465"/>
+						<reference key="parent" ref="962619467"/>
+					</object>
 				</array>
 			</object>
 			<dictionary class="NSMutableDictionary" key="flattenedProperties">
@@ -317,6 +354,8 @@
 				<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 				<string key="23.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 				<string key="25.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+				<string key="28.CustomClassName">VLCStatusLabel</string>
+				<string key="28.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 				<string key="3.CustomClassName">VLCLocalNetworkListCell</string>
 				<string key="3.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 				<string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@@ -327,7 +366,7 @@
 			<nil key="activeLocalization"/>
 			<dictionary class="NSMutableDictionary" key="localizations"/>
 			<nil key="sourceID"/>
-			<int key="maxID">27</int>
+			<int key="maxID">29</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<array class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -348,6 +387,7 @@
 					<dictionary class="NSMutableDictionary" key="outlets">
 						<string key="downloadButton">UIButton</string>
 						<string key="folderTitleLabel">UILabel</string>
+						<string key="statusLabel">VLCStatusLabel</string>
 						<string key="subtitleLabel">UILabel</string>
 						<string key="thumbnailView">UIImageView</string>
 						<string key="titleLabel">UILabel</string>
@@ -361,6 +401,10 @@
 							<string key="name">folderTitleLabel</string>
 							<string key="candidateClassName">UILabel</string>
 						</object>
+						<object class="IBToOneOutletInfo" key="statusLabel">
+							<string key="name">statusLabel</string>
+							<string key="candidateClassName">VLCStatusLabel</string>
+						</object>
 						<object class="IBToOneOutletInfo" key="subtitleLabel">
 							<string key="name">subtitleLabel</string>
 							<string key="candidateClassName">UILabel</string>
@@ -379,6 +423,14 @@
 						<string key="minorKey">./Classes/VLCLocalNetworkListCell.h</string>
 					</object>
 				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">VLCStatusLabel</string>
+					<string key="superclassName">UILabel</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">./Classes/VLCStatusLabel.h</string>
+					</object>
+				</object>
 			</array>
 		</object>
 		<int key="IBDocument.localizationMode">0</int>