Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 47 additions & 60 deletions AppSales.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
110 changes: 110 additions & 0 deletions AppSales/Images.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"images" : [
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "29.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "58.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "80.png",
"scale" : "2x"
},
{
"size" : "57x57",
"idiom" : "iphone",
"filename" : "Icon57.png",
"scale" : "1x"
},
{
"size" : "57x57",
"idiom" : "iphone",
"filename" : "Icon114.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon114-1.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "180.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "29-1.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "58-1.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "40.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "80-1.png",
"scale" : "2x"
},
{
"size" : "50x50",
"idiom" : "ipad",
"filename" : "50.png",
"scale" : "1x"
},
{
"size" : "50x50",
"idiom" : "ipad",
"filename" : "100.png",
"scale" : "2x"
},
{
"size" : "72x72",
"idiom" : "ipad",
"filename" : "Icon72.png",
"scale" : "1x"
},
{
"size" : "72x72",
"idiom" : "ipad",
"filename" : "144.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "76.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "152.png",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
53 changes: 53 additions & 0 deletions AppSales/Images.xcassets/LaunchImage.launchimage/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"images" : [
{
"orientation" : "portrait",
"idiom" : "iphone",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"filename" : "iOS-Simulator-Screen-shot-26-Sep-2013-11.29.41-4.png",
"scale" : "2x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "retina4",
"filename" : "iOS-Simulator-Screen-shot-26-Sep-2013-11.29.41-3.png",
"minimum-system-version" : "7.0",
"orientation" : "portrait",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Classes/AboutViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)

- (void)done:(id)sender
{
[self dismissModalViewControllerAnimated:YES];
[self dismissViewControllerAnimated:YES completion:nil];
}

- (void)dealloc
Expand Down
2 changes: 1 addition & 1 deletion Classes/AccountStatusView.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ - (id)initWithFrame:(CGRect)frame account:(ASAccount *)anAccount
statusLabel.textColor = [UIColor colorWithRed:0.322 green:0.357 blue:0.443 alpha:1.0];
statusLabel.shadowColor = [UIColor whiteColor];
statusLabel.shadowOffset = CGSizeMake(0, 1);
statusLabel.textAlignment = UITextAlignmentCenter;
statusLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:statusLabel];

[self updateStatus];
Expand Down
4 changes: 2 additions & 2 deletions Classes/AccountsViewController+VendorID.m
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ - (void)findVendorIDsWithLogin:(NSDictionary *)loginInfo

- (void)finishedLoadingVendorID:(NSString *)vendorID
{
if (self.modalViewController) {
if (self.presentedViewController) {
//Adding new account:
FieldEditorViewController *vc = [[(UINavigationController *)self.modalViewController viewControllers] objectAtIndex:0];
FieldEditorViewController *vc = [[(UINavigationController *)self.presentedViewController viewControllers] objectAtIndex:0];
[vc.values setObject:vendorID forKey:kAccountVendorID];
[vc.tableView reloadData];
} else {
Expand Down
41 changes: 29 additions & 12 deletions Classes/AccountsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#import "KKPasscodeLock.h"
#import "ZipFile.h"
#import "ZipWriteStream.h"
#import "IconManager.h"

#define kAddNewAccountEditorIdentifier @"AddNewAccountEditorIdentifier"
#define kEditAccountEditorIdentifier @"EditAccountEditorIdentifier"
Expand Down Expand Up @@ -71,6 +72,8 @@ - (void)viewDidLoad

[[ReportDownloadCoordinator sharedReportDownloadCoordinator] addObserver:self forKeyPath:@"isBusy" options:NSKeyValueObservingOptionNew context:nil];

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(iconCleared:) name:IconManagerClearedIconNotification object:nil];

[self reloadAccounts];
}

Expand Down Expand Up @@ -133,7 +136,7 @@ - (void)showInfo:(id)sender
} else {
aboutNavController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
}
[self presentModalViewController:aboutNavController animated:YES];
[self presentViewController:aboutNavController animated:YES completion:nil];
}


Expand Down Expand Up @@ -294,6 +297,7 @@ - (void)deleteAccount:(NSManagedObject *)account
[context deleteObject:account];
[MBProgressHUD hideHUDForView:self.navigationController.view animated:YES];
[self reloadAccounts];
[self.navigationController popViewControllerAnimated:YES];
}
}

Expand Down Expand Up @@ -325,7 +329,7 @@ - (void)addNewAccount
navigationController.modalPresentationStyle = UIModalPresentationFormSheet;

}
[self presentModalViewController:navigationController animated:YES];
[self presentViewController:navigationController animated:YES completion:nil];
}

- (void)editAccount:(ASAccount *)account
Expand Down Expand Up @@ -363,7 +367,8 @@ - (void)editAccount:(ASAccount *)account
for (Product *product in allProducts) {
FieldSpecifier *productNameField = [FieldSpecifier textFieldWithKey:[NSString stringWithFormat:@"product.name.%@", product.productID] title:NSLocalizedString(@"Name", nil) defaultValue:[product displayName]];
FieldSpecifier *hideProductField = [FieldSpecifier switchFieldWithKey:[NSString stringWithFormat:@"product.hidden.%@", product.productID] title:NSLocalizedString(@"Hide in Dashboard", nil) defaultValue:[product.hidden boolValue]];
FieldSectionSpecifier *productSection = [FieldSectionSpecifier sectionWithFields:[NSArray arrayWithObjects:productNameField, hideProductField, nil] title:nil description:nil];
FieldSpecifier *reloadProductInfoField = [FieldSpecifier buttonFieldWithKey:[NSString stringWithFormat:@"product.reload.%@", product.productID] title:NSLocalizedString(@"Reload App Icon...", nil)];
FieldSectionSpecifier *productSection = [FieldSectionSpecifier sectionWithFields:[NSArray arrayWithObjects:productNameField, hideProductField, reloadProductInfoField, nil] title:nil description:nil];
FieldSpecifier *showInAppStoreField = [FieldSpecifier buttonFieldWithKey:[NSString stringWithFormat:@"product.appstore.%@", product.productID] title:NSLocalizedString(@"Show in App Store...", nil)];
NSString *productFooter = [NSString stringWithFormat:@"Current version: %@\nApple ID: %@", ((product.currentVersion) ? product.currentVersion : @"N/A"), product.productID];
FieldSectionSpecifier *showInAppStoreSection = [FieldSectionSpecifier sectionWithFields:[NSArray arrayWithObject:showInAppStoreField] title:nil description:productFooter];
Expand All @@ -390,7 +395,7 @@ - (void)editAccount:(ASAccount *)account
editAccountViewController.hidesBottomBarWhenPushed = YES;
}

editAccountViewController.contentSizeForViewInPopover = CGSizeMake(320, 480);
editAccountViewController.preferredContentSize = CGSizeMake(320, 480);

[self.navigationController pushViewController:editAccountViewController animated:YES];
}
Expand Down Expand Up @@ -431,7 +436,7 @@ - (void)showSettings
defaultValue:[productSortByValue isEqualToString:@"productId"]];
FieldSpecifier *productSortingByColorField = [FieldSpecifier checkFieldWithKey:@"sortby.color" title:@"Color"
defaultValue:[productSortByValue isEqualToString:@"color"]];
NSMutableArray *productSortingFields = [NSArray arrayWithObjects:productSortingByProductIdField, productSortingByColorField, nil];
NSMutableArray *productSortingFields = [NSMutableArray arrayWithObjects:productSortingByProductIdField, productSortingByColorField, nil];


FieldSectionSpecifier *productSortingSection = [FieldSectionSpecifier sectionWithFields:productSortingFields
Expand Down Expand Up @@ -462,7 +467,7 @@ - (void)showSettings
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
settingsNavController.modalPresentationStyle = UIModalPresentationFormSheet;
}
[self presentModalViewController:settingsNavController animated:YES];
[self presentViewController:settingsNavController animated:YES completion:nil];
}

- (void)fieldEditor:(FieldEditorViewController *)editor didFinishEditingWithValues:(NSDictionary *)returnValues
Expand Down Expand Up @@ -517,7 +522,7 @@ - (void)fieldEditor:(FieldEditorViewController *)editor didFinishEditingWithValu
}
[self saveContext];
if ([editor.editorIdentifier isEqualToString:kAddNewAccountEditorIdentifier]) {
[editor dismissModalViewControllerAnimated:YES];
[editor dismissViewControllerAnimated:YES completion:nil];
}
self.selectedAccount = nil;
} else if ([editor.editorIdentifier isEqualToString:kSettingsEditorIdentifier]) {
Expand All @@ -534,7 +539,7 @@ - (void)fieldEditor:(FieldEditorViewController *)editor didFinishEditingWithValu
}
}
[[NSUserDefaults standardUserDefaults] setBool:[[returnValues objectForKey:kSettingDownloadPayments] boolValue] forKey:kSettingDownloadPayments];
[self dismissModalViewControllerAnimated:YES];
[self dismissViewControllerAnimated:YES completion:nil];

[[NSNotificationCenter defaultCenter] postNotificationName:ASViewSettingsDidChangeNotification object:nil];
}
Expand Down Expand Up @@ -574,6 +579,10 @@ - (void)fieldEditor:(FieldEditorViewController *)editor pressedButtonWithKey:(NS
NSString *productID = [key substringFromIndex:[@"product.appstore." length]];
NSString *appStoreURLString = [NSString stringWithFormat:@"http://itunes.apple.com/app/id%@", productID];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:appStoreURLString]];
} else if ([key hasPrefix:@"product.reload."]) {
NSString *productID = [key substringFromIndex:[@"product.reload." length]];
IconManager *iconManager = [IconManager sharedManager];
[iconManager clearIconForAppID:productID];
} else if ([key isEqualToString:kDeleteAccountButton]) {
UIAlertView *confirmDeleteAlert = [[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Delete Account?", nil)
message:NSLocalizedString(@"Do you really want to delete this account and all of its data?", nil)
Expand All @@ -584,8 +593,8 @@ - (void)fieldEditor:(FieldEditorViewController *)editor pressedButtonWithKey:(NS
[confirmDeleteAlert show];
} else if ([key isEqualToString:@"SelectVendorIDButton"]) {
FieldEditorViewController *vc = nil;
if (self.modalViewController) {
UINavigationController *nav = (UINavigationController *)self.modalViewController;
if (self.presentedViewController) {
UINavigationController *nav = (UINavigationController *)self.presentedViewController;
vc = (FieldEditorViewController *)[[nav viewControllers] objectAtIndex:0];
} else {
vc = (FieldEditorViewController *)[self.navigationController.viewControllers lastObject];
Expand Down Expand Up @@ -712,7 +721,6 @@ - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)butto
[hud setLabelText:NSLocalizedString(@"Deleting Account...", nil)];

ASAccount *account = [[self.selectedAccount retain] autorelease];
[self.navigationController popViewControllerAnimated:YES];
[self performSelector:@selector(deleteAccount:) withObject:account afterDelay:0.1];
}
}
Expand All @@ -739,7 +747,7 @@ - (void)documentInteractionControllerDidDismissOpenInMenu:(UIDocumentInteraction

- (void)fieldEditorDidCancel:(FieldEditorViewController *)editor
{
[editor dismissModalViewControllerAnimated:YES];
[editor dismissViewControllerAnimated:YES completion:nil];
}

- (void)didSettingsChanged:(KKPasscodeSettingsViewController*)viewController
Expand All @@ -754,6 +762,15 @@ - (void)didSettingsChanged:(KKPasscodeSettingsViewController*)viewController
[settingsViewController.tableView reloadData];
}

- (void)iconCleared:(NSNotification *)notification
{
NSString *productID = [[notification userInfo] objectForKey:kIconManagerClearedIconNotificationAppID];
if (productID) {
// reload Icon
[[IconManager sharedManager] iconForAppID:productID];
}
}

#pragma mark -

- (void)saveContext
Expand Down
8 changes: 8 additions & 0 deletions Classes/AppIconView.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ - (void)setProductID:(NSString *)newProductID
if ([newProductID isEqualToString:productID]) return;
if (!productID) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(iconDownloaded:) name:IconManagerDownloadedIconNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(iconCleared:) name:IconManagerClearedIconNotification object:nil];
}

[newProductID retain];
Expand All @@ -38,6 +39,13 @@ - (void)iconDownloaded:(NSNotification *)notification
}
}

- (void)iconCleared:(NSNotification *)notification
{
if ([[[notification userInfo] objectForKey:kIconManagerClearedIconNotificationAppID] isEqualToString:self.productID]) {
self.image = [UIImage imageNamed:@"GenericApp.png"];
}
}

- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
Expand Down
Loading