Merge lp:~urbanape/ubuntuone-ios-client/2.0-14-prerelease into lp:ubuntuone-ios-client

Proposed by Zachery Bir
Status: Merged
Approved by: Zachery Bir
Approved revision: 205
Merged at revision: 197
Proposed branch: lp:~urbanape/ubuntuone-ios-client/2.0-14-prerelease
Merge into: lp:ubuntuone-ios-client
Diff against target: 217 lines (+64/-24)
6 files modified
musicstreaming/iSub-Info.plist (+1/-1)
musicstreaming/iSub.xcodeproj/project.pbxproj (+8/-0)
musicstreaming/view_controllers/AlbumViewController.m (+40/-14)
musicstreaming/view_controllers/PlaylistEditAlbumViewController.m (+4/-1)
musicstreaming/view_controllers/PlaylistEditSongListViewController.m (+3/-0)
musicstreaming/view_controllers/SubsonicIndexedTableViewController.m (+8/-8)
To merge this branch: bzr merge lp:~urbanape/ubuntuone-ios-client/2.0-14-prerelease
Reviewer Review Type Date Requested Status
Jason Foreman (community) Approve
Review via email: mp+65555@code.launchpad.net

Description of the change

This branch keeps the alerts coming (dismissed once with "Remind Me", dismissed permanently with "Dismiss").

To post a comment you must log in.
Revision history for this message
Jason Foreman (threeve) wrote :

Looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'musicstreaming/iSub-Info.plist'
2--- musicstreaming/iSub-Info.plist 2011-06-21 18:51:39 +0000
3+++ musicstreaming/iSub-Info.plist 2011-06-22 19:26:01 +0000
4@@ -41,7 +41,7 @@
5 </dict>
6 </array>
7 <key>CFBundleVersion</key>
8- <string>11</string>
9+ <string>14</string>
10 <key>LSRequiresIPhoneOS</key>
11 <false/>
12 <key>NSMainNibFile</key>
13
14=== modified file 'musicstreaming/iSub.xcodeproj/project.pbxproj'
15--- musicstreaming/iSub.xcodeproj/project.pbxproj 2011-06-21 17:04:19 +0000
16+++ musicstreaming/iSub.xcodeproj/project.pbxproj 2011-06-22 19:26:01 +0000
17@@ -59,6 +59,8 @@
18 91BE4018138E8D2300D44D68 /* UIActionSheet+Blocks.m in Sources */ = {isa = PBXBuildFile; fileRef = 91BE4015138E8D2300D44D68 /* UIActionSheet+Blocks.m */; };
19 91BE4019138E8D2300D44D68 /* UIAlertView+Blocks.m in Sources */ = {isa = PBXBuildFile; fileRef = 91BE4017138E8D2300D44D68 /* UIAlertView+Blocks.m */; };
20 91BE401C138E8D3A00D44D68 /* RIButtonItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 91BE401B138E8D3A00D44D68 /* RIButtonItem.m */; };
21+ 91D18DAB13B228D3001BEB42 /* uncached-disabled.png in Resources */ = {isa = PBXBuildFile; fileRef = 91D18DA913B228D3001BEB42 /* uncached-disabled.png */; };
22+ 91D18DAC13B228D3001BEB42 /* uncached-disabled@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 91D18DAA13B228D3001BEB42 /* uncached-disabled@2x.png */; };
23 91E0778913ABAD6200AA7CB2 /* PlaylistSongIndex.m in Sources */ = {isa = PBXBuildFile; fileRef = 91E0778813ABAD6200AA7CB2 /* PlaylistSongIndex.m */; };
24 91E88609132DA82000618994 /* PlaylistParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 91E88608132DA82000618994 /* PlaylistParser.m */; };
25 9316628812264A74003B0EB7 /* NSDate+Extras.m in Sources */ = {isa = PBXBuildFile; fileRef = 9316628712264A74003B0EB7 /* NSDate+Extras.m */; };
26@@ -221,6 +223,8 @@
27 91BE4017138E8D2300D44D68 /* UIAlertView+Blocks.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIAlertView+Blocks.m"; sourceTree = "<group>"; };
28 91BE401A138E8D3A00D44D68 /* RIButtonItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RIButtonItem.h; sourceTree = "<group>"; };
29 91BE401B138E8D3A00D44D68 /* RIButtonItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RIButtonItem.m; sourceTree = "<group>"; };
30+ 91D18DA913B228D3001BEB42 /* uncached-disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "uncached-disabled.png"; sourceTree = "<group>"; };
31+ 91D18DAA13B228D3001BEB42 /* uncached-disabled@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "uncached-disabled@2x.png"; sourceTree = "<group>"; };
32 91E0778713ABAD6100AA7CB2 /* PlaylistSongIndex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlaylistSongIndex.h; sourceTree = "<group>"; };
33 91E0778813ABAD6200AA7CB2 /* PlaylistSongIndex.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PlaylistSongIndex.m; sourceTree = "<group>"; };
34 91E88607132DA82000618994 /* PlaylistParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlaylistParser.h; sourceTree = "<group>"; };
35@@ -420,6 +424,8 @@
36 91406E9113849F2400A7DA67 /* partiallycached@2x.png */,
37 91406E9213849F2400A7DA67 /* uncached.png */,
38 91406E9313849F2400A7DA67 /* uncached@2x.png */,
39+ 91D18DA913B228D3001BEB42 /* uncached-disabled.png */,
40+ 91D18DAA13B228D3001BEB42 /* uncached-disabled@2x.png */,
41 5305C2051157F4F800BC78F0 /* Default.png */,
42 932E7A6D1254747E00E7C8FF /* Default@2x.png */,
43 93D6B50B1252CA71007880B0 /* music_57.png */,
44@@ -833,6 +839,8 @@
45 91406E9713849F2400A7DA67 /* partiallycached@2x.png in Resources */,
46 91406E9813849F2400A7DA67 /* uncached.png in Resources */,
47 91406E9913849F2400A7DA67 /* uncached@2x.png in Resources */,
48+ 91D18DAB13B228D3001BEB42 /* uncached-disabled.png in Resources */,
49+ 91D18DAC13B228D3001BEB42 /* uncached-disabled@2x.png in Resources */,
50 );
51 runOnlyForDeploymentPostprocessing = 0;
52 };
53
54=== added file 'musicstreaming/uncached-disabled.png'
55Binary files musicstreaming/uncached-disabled.png 1970-01-01 00:00:00 +0000 and musicstreaming/uncached-disabled.png 2011-06-22 19:26:01 +0000 differ
56=== added file 'musicstreaming/uncached-disabled@2x.png'
57Binary files musicstreaming/uncached-disabled@2x.png 1970-01-01 00:00:00 +0000 and musicstreaming/uncached-disabled@2x.png 2011-06-22 19:26:01 +0000 differ
58=== modified file 'musicstreaming/view_controllers/AlbumViewController.m'
59--- musicstreaming/view_controllers/AlbumViewController.m 2011-06-16 19:12:54 +0000
60+++ musicstreaming/view_controllers/AlbumViewController.m 2011-06-22 19:26:01 +0000
61@@ -27,6 +27,8 @@
62 #import "NSDate+Extras.h"
63 #import "StreamingPlayer.h"
64 #import "Downloader.h"
65+#import "UIAlertView+Blocks.h"
66+#import "RIButtonItem.h"
67
68 @interface AlbumViewController (Private)
69 - (void)setupHeaderAndFooter;
70@@ -141,7 +143,7 @@
71 Song *song = [self.songs objectAtIndex:indexPath.row];
72
73 // explicitly re-set the default state of the button/spinner
74- [cell.cacheButton setImage:[UIImage imageNamed:@"uncached"] forState:UIControlStateNormal];
75+ [cell.cacheButton setImage:(canCache ? [UIImage imageNamed:@"uncached"] : [UIImage imageNamed:@"uncached-disabled"]) forState:UIControlStateNormal];
76 [cell.spinner stopAnimating];
77
78 cell.cacheButton.tag = indexPath.row;
79@@ -179,7 +181,6 @@
80 }
81
82 cell.evenRow = (0 == indexPath.row % 2);
83- [cell.cacheButton setEnabled:canCache];
84 if (song.cachedSongPath == nil && !canStream)
85 {
86 cell.songNameLabel.textColor = [UIColor lightGrayColor];
87@@ -270,7 +271,6 @@
88 - (void)toggleCacheForSong:(id)sender
89 {
90 // This is a binary toggle, and right now, we don't bother trying to cancel a download in progress.
91-
92 int row = [(UIButton *)sender tag];
93
94 NSIndexPath *songPath = [NSIndexPath indexPathForRow:row inSection:0];
95@@ -292,16 +292,42 @@
96 }
97 else
98 {
99- [cell.spinner startAnimating];
100- [[Downloader sharedDownloader] downloadFile:[[Subsonic sharedSubsonic] getStreamingURLForSongId:song.songId] withName:song.songId completionBlock:^(NSString *path) {
101- dispatch_async(dispatch_get_main_queue(), ^(void) {
102- song.cachedSongPath = path;
103- SaveContext();
104- SongUITableViewCell *cell = (SongUITableViewCell *)[self.tableView cellForRowAtIndexPath:songPath];
105- [cell.spinner stopAnimating];
106- [cell.cacheButton setImage:[UIImage imageNamed:@"cached"] forState:UIControlStateNormal];
107- });
108- }];
109+ if (canCache)
110+ {
111+ [cell.spinner startAnimating];
112+ [[Downloader sharedDownloader] downloadFile:[[Subsonic sharedSubsonic] getStreamingURLForSongId:song.songId] withName:song.songId completionBlock:^(NSString *path) {
113+ dispatch_async(dispatch_get_main_queue(), ^(void) {
114+ song.cachedSongPath = path;
115+ SaveContext();
116+ SongUITableViewCell *cell = (SongUITableViewCell *)[self.tableView cellForRowAtIndexPath:songPath];
117+ [cell.spinner stopAnimating];
118+ [cell.cacheButton setImage:[UIImage imageNamed:@"cached"] forState:UIControlStateNormal];
119+ });
120+ }];
121+ }
122+ else
123+ {
124+ NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
125+ if (![defaults boolForKey:@"acknowledged-no-cache-on-3g"])
126+ {
127+ RIButtonItem *cancelButton = [RIButtonItem item];
128+ cancelButton.label = NSLocalizedString(@"Remind Me", @"");
129+
130+ RIButtonItem *dismissButton = [RIButtonItem item];
131+ dismissButton.label = NSLocalizedString(@"Dismiss", @"");
132+ dismissButton.action = ^
133+ {
134+ [defaults setBool:YES forKey:@"acknowledged-no-cache-on-3g"];
135+ };
136+
137+ UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Caching Disabled", @"")
138+ message:NSLocalizedString(@"Caching songs can only be done on WiFi networks.", @"")
139+ cancelButtonItem:cancelButton otherButtonItems:dismissButton, nil];
140+ [alertView show];
141+ [alertView release];
142+
143+ }
144+ }
145 }
146 }
147 }
148@@ -377,4 +403,4 @@
149 [bigFooterView release];
150 }
151
152-@end
153\ No newline at end of file
154+@end
155
156=== modified file 'musicstreaming/view_controllers/PlaylistEditAlbumViewController.m'
157--- musicstreaming/view_controllers/PlaylistEditAlbumViewController.m 2011-06-21 17:04:19 +0000
158+++ musicstreaming/view_controllers/PlaylistEditAlbumViewController.m 2011-06-22 19:26:01 +0000
159@@ -49,7 +49,10 @@
160 {
161 cell = [[[PlaylistEditSongUITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:SongCellIdentifier] autorelease];
162 }
163-
164+
165+ // explicitly re-set the default state of the checkmark
166+ cell.accessoryType = UITableViewCellAccessoryNone;
167+
168 Song *song = [self.songs objectAtIndex:indexPath.row];
169
170 cell.songNameLabel.text = song.title;
171
172=== modified file 'musicstreaming/view_controllers/PlaylistEditSongListViewController.m'
173--- musicstreaming/view_controllers/PlaylistEditSongListViewController.m 2011-06-18 02:04:11 +0000
174+++ musicstreaming/view_controllers/PlaylistEditSongListViewController.m 2011-06-22 19:26:01 +0000
175@@ -51,6 +51,9 @@
176 cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
177 }
178
179+ // explicitly re-set the default state of the checkmark
180+ cell.accessoryType = UITableViewCellAccessoryNone;
181+
182 Song *s = nil;
183
184 if (self.searchDisplayController.searchResultsTableView == tableView)
185
186=== modified file 'musicstreaming/view_controllers/SubsonicIndexedTableViewController.m'
187--- musicstreaming/view_controllers/SubsonicIndexedTableViewController.m 2011-05-27 18:31:56 +0000
188+++ musicstreaming/view_controllers/SubsonicIndexedTableViewController.m 2011-06-22 19:26:01 +0000
189@@ -34,14 +34,6 @@
190 return self;
191 }
192
193-- (void)didReceiveMemoryWarning
194-{
195- [super didReceiveMemoryWarning];
196-
197- self.indexes = NULL;
198- self.groupedTableData = NULL;
199-}
200-
201 - (void)dealloc
202 {
203 self.indexes = NULL;
204@@ -51,6 +43,14 @@
205 [super dealloc];
206 }
207
208+- (void)viewDidUnload
209+{
210+ self.indexes = nil;
211+ self.groupedTableData = [NSMutableDictionary dictionary];
212+
213+ [super viewDidUnload];
214+}
215+
216 #pragma mark -
217 #pragma mark Notifications
218

Subscribers

People subscribed via source and target branches

to all changes: