Merge lp:~mikemc/ubuntuone-ios-files/use-options-menu into lp:ubuntuone-ios-files

Proposed by Mike McCracken
Status: Merged
Approved by: dobey
Approved revision: 110
Merged at revision: 108
Proposed branch: lp:~mikemc/ubuntuone-ios-files/use-options-menu
Merge into: lp:ubuntuone-ios-files
Diff against target: 71 lines (+8/-35)
2 files modified
Files/U1FileDetailsViewController.m (+4/-31)
Files/U1FilePreviewViewController.m (+4/-4)
To merge this branch: bzr merge lp:~mikemc/ubuntuone-ios-files/use-options-menu
Reviewer Review Type Date Requested Status
dobey (community) Approve
Review via email: mp+166868@code.launchpad.net

Commit message

Use "options menu" instead of "open-in" menu to let users do more things with downloaded files.

Description of the change

See bug LP: #1186362 for a screenshot of the new options menu from the simulator

presents a menu with a superset of functionality, adding useful things like save to photo roll or tweet/fb/weibo an image, or mail the file for other files.

NOTE, also adds an autorelease for the alert view, since it will leak. However, it looks like since you can always email a file, we may never create that alert view in the first place. Still.

To post a comment you must log in.
Revision history for this message
dobey (dobey) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Files/U1FileDetailsViewController.m'
2--- Files/U1FileDetailsViewController.m 2013-05-24 18:26:45 +0000
3+++ Files/U1FileDetailsViewController.m 2013-05-31 18:07:36 +0000
4@@ -324,43 +324,16 @@
5 [self.navigationController pushViewController:previewController animated:YES];
6 [previewController release];
7
8-// QLPreviewController *previewController = [[QLPreviewController alloc] init];
9-// previewController.dataSource = self;
10-// previewController.delegate = self;
11-//
12-// UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 20)];
13-// // TODO: Ubuntu font
14-// [titleLabel setFont:[UIFont boldSystemFontOfSize:18.f]];
15-// [titleLabel setTextColor:[UIColor blackColor]];
16-// [titleLabel setShadowColor:[UIColor whiteColor]];
17-// [titleLabel setShadowOffset:CGSizeMake(-1, -1)];
18-// [titleLabel setText:self.title];
19-// [titleLabel sizeToFit];
20-// [titleLabel setOpaque:NO];
21-// [titleLabel setBackgroundColor:[UIColor clearColor]];
22-// [previewController.navigationItem setTitleView:titleLabel];
23-// [titleLabel release];
24-//
25-//// [self.navigationController presentModalViewController:previewController animated:YES];
26-// [self.navigationController pushViewController:previewController animated:YES];
27-// [previewController release];
28-//
29-// // TODO: manage preview view vs. modal presentation
30-//// UIView *previewView = previewController.view;
31-//// previewView.frame = [self.view bounds];
32-//// [previewController viewWillAppear:NO];
33-//// [self.view addSubview:previewView];
34-//// [previewController viewDidAppear:NO];
35 }
36
37 - (IBAction)openIn:(UIBarButtonItem*)sender;
38 {
39- BOOL success = [self.docController presentOpenInMenuFromBarButtonItem:sender animated:YES];
40+ BOOL success = [self.docController presentOptionsMenuFromBarButtonItem:sender animated:YES];
41 if(!success){
42- UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Unable to Open File"
43- message:@"No apps that can open this file type were found."
44+ UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"No Options Available"
45+ message:@"No external options found for this file type."
46 delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
47- [alertView show];
48+ [[alertView autorelease] show];
49 }
50 }
51
52
53=== modified file 'Files/U1FilePreviewViewController.m'
54--- Files/U1FilePreviewViewController.m 2013-04-03 23:01:10 +0000
55+++ Files/U1FilePreviewViewController.m 2013-05-31 18:07:36 +0000
56@@ -178,12 +178,12 @@
57
58 - (IBAction)openIn:(UIBarButtonItem*)sender;
59 {
60- BOOL success = [self.docController presentOpenInMenuFromBarButtonItem:sender animated:YES];
61+ BOOL success = [self.docController presentOptionsMenuFromBarButtonItem:sender animated:YES];
62 if(!success){
63- UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Unable to Open File"
64- message:@"No apps that can open this file type were found."
65+ UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"No Options Available"
66+ message:@"No external options found for this file type."
67 delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
68- [alertView show];
69+ [[alertView autorelease] show];
70 }
71 }
72

Subscribers

People subscribed via source and target branches