Skip to content

Commit

Permalink
Release 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Tristan Seifert committed Jan 21, 2014
1 parent 2c5c7d4 commit d1f94f3
Show file tree
Hide file tree
Showing 16 changed files with 84 additions and 73 deletions.
24 changes: 3 additions & 21 deletions QuickHAC/QuickHAC.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
DE3AC657187B5A37007540A9 /* NSDate+RelativeDate.m in Sources */ = {isa = PBXBuildFile; fileRef = DE3AC656187B5A37007540A9 /* NSDate+RelativeDate.m */; };
DE3AC65C187B63D3007540A9 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = DE3AC65A187B63D3007540A9 /* Localizable.strings */; };
DE485DD81881CEE800B215C6 /* SQUSidebarSwitcherButton.m in Sources */ = {isa = PBXBuildFile; fileRef = DE485DD71881CEE800B215C6 /* SQUSidebarSwitcherButton.m */; };
DE485DDB1881D67500B215C6 /* default_avatar.jpg in Resources */ = {isa = PBXBuildFile; fileRef = DE485DDA1881D67500B215C6 /* default_avatar.jpg */; };
DE485DDE1881EACA00B215C6 /* SQUUserSwitcherView.m in Sources */ = {isa = PBXBuildFile; fileRef = DE485DDD1881EACA00B215C6 /* SQUUserSwitcherView.m */; };
DE485DE31881FAC700B215C6 /* SQUUserSwitcherCell.m in Sources */ = {isa = PBXBuildFile; fileRef = DE485DE21881FAC700B215C6 /* SQUUserSwitcherCell.m */; };
DE4D5BB21888CA3E00371A75 /* about.rtfd in Resources */ = {isa = PBXBuildFile; fileRef = DE4D5BB11888CA3E00371A75 /* about.rtfd */; };
Expand All @@ -64,7 +63,6 @@
DEF0F1BD186EE52B00116B61 /* UIColor+SQUColourUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = DEF0F1BC186EE52B00116B61 /* UIColor+SQUColourUtilities.m */; };
DEF0F1BF186EEA6500116B61 /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DEF0F1BE186EEA6400116B61 /* CoreImage.framework */; };
DEF0F1C1186EEA6900116B61 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DEF0F1C0186EEA6900116B61 /* QuartzCore.framework */; };
DEF0F1C5186EEB9500116B61 /* UIView+JMNoise.m in Sources */ = {isa = PBXBuildFile; fileRef = DEF0F1C4186EEB9500116B61 /* UIView+JMNoise.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
DEF0F1CB186F7D8F00116B61 /* SQUClassDetailController.m in Sources */ = {isa = PBXBuildFile; fileRef = DEF0F1CA186F7D8F00116B61 /* SQUClassDetailController.m */; };
DEF0F1CE186F7D9E00116B61 /* SQUClassDetailCell.m in Sources */ = {isa = PBXBuildFile; fileRef = DEF0F1CD186F7D9E00116B61 /* SQUClassDetailCell.m */; };
DEF0F1D7186FC7FA00116B61 /* SQUAssignment.m in Sources */ = {isa = PBXBuildFile; fileRef = DEF0F1D6186FC7FA00116B61 /* SQUAssignment.m */; };
Expand Down Expand Up @@ -217,7 +215,6 @@
DE3AC65B187B63D3007540A9 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
DE485DD61881CEE700B215C6 /* SQUSidebarSwitcherButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQUSidebarSwitcherButton.h; sourceTree = "<group>"; };
DE485DD71881CEE800B215C6 /* SQUSidebarSwitcherButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SQUSidebarSwitcherButton.m; sourceTree = "<group>"; };
DE485DDA1881D67500B215C6 /* default_avatar.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = default_avatar.jpg; path = "assets/sidebar UI/default_avatar.jpg"; sourceTree = SOURCE_ROOT; };
DE485DDC1881EACA00B215C6 /* SQUUserSwitcherView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQUUserSwitcherView.h; sourceTree = "<group>"; };
DE485DDD1881EACA00B215C6 /* SQUUserSwitcherView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SQUUserSwitcherView.m; sourceTree = "<group>"; };
DE485DE11881FAC700B215C6 /* SQUUserSwitcherCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQUUserSwitcherCell.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -261,8 +258,6 @@
DEF0F1BC186EE52B00116B61 /* UIColor+SQUColourUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIColor+SQUColourUtilities.m"; sourceTree = "<group>"; };
DEF0F1BE186EEA6400116B61 /* CoreImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreImage.framework; path = System/Library/Frameworks/CoreImage.framework; sourceTree = SDKROOT; };
DEF0F1C0186EEA6900116B61 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
DEF0F1C3186EEB9500116B61 /* UIView+JMNoise.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIView+JMNoise.h"; path = "../../JMNoise/JMNoise/UIView+JMNoise.h"; sourceTree = "<group>"; };
DEF0F1C4186EEB9500116B61 /* UIView+JMNoise.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIView+JMNoise.m"; path = "../../JMNoise/JMNoise/UIView+JMNoise.m"; sourceTree = "<group>"; };
DEF0F1C9186F7D8F00116B61 /* SQUClassDetailController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQUClassDetailController.h; sourceTree = "<group>"; };
DEF0F1CA186F7D8F00116B61 /* SQUClassDetailController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SQUClassDetailController.m; sourceTree = "<group>"; };
DEF0F1CC186F7D9E00116B61 /* SQUClassDetailCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQUClassDetailCell.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -458,9 +453,8 @@
DE0615E717891E23004B2877 /* 3rd Party */,
DE06158B17874D0D004B2877 /* SQUAppDelegate.h */,
DE06158C17874D0D004B2877 /* SQUAppDelegate.m */,
DE485DDA1881D67500B215C6 /* default_avatar.jpg */,
DE06159117874D0D004B2877 /* Images.xcassets */,
DEF0F2491873FB6700116B61 /* iPad Resources */,
DEF0F2491873FB6700116B61 /* Images */,
DE06158E17874D0D004B2877 /* QuickHAC.xcdatamodeld */,
DE06158317874D0D004B2877 /* Miscellaneous Resources */,
DE06158817874D0D004B2877 /* main.m */,
Expand Down Expand Up @@ -549,7 +543,6 @@
DEF0F24A18740A0200116B61 /* MGSplitViewController */,
DEF0F22618727EA700116B61 /* LTHPasscodeViewController */,
DEF0F1DE1870E60B00116B61 /* WYPopoverController */,
DEF0F1C2186EEB8000116B61 /* JMNoise */,
DE7B4E82186EB0CB008079CC /* KCOrderedAccessorFix */,
DE81CDD0186D50E800DC1CAB /* TFHpple (HTML Parsing) */,
DE35E9A61806147900F15F20 /* Lockbox (Keychain) */,
Expand Down Expand Up @@ -728,15 +721,6 @@
name = "Miscellaneous UI";
sourceTree = "<group>";
};
DEF0F1C2186EEB8000116B61 /* JMNoise */ = {
isa = PBXGroup;
children = (
DEF0F1C3186EEB9500116B61 /* UIView+JMNoise.h */,
DEF0F1C4186EEB9500116B61 /* UIView+JMNoise.m */,
);
name = JMNoise;
sourceTree = "<group>";
};
DEF0F1DE1870E60B00116B61 /* WYPopoverController */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -773,12 +757,12 @@
path = ../../LTHPasscodeViewController/LTHPasscodeViewController;
sourceTree = "<group>";
};
DEF0F2491873FB6700116B61 /* iPad Resources */ = {
DEF0F2491873FB6700116B61 /* Images */ = {
isa = PBXGroup;
children = (
DE0A58AA188CEEC8001A5D17 /* blurry_bg.jpg */,
);
name = "iPad Resources";
name = Images;
sourceTree = "<group>";
};
DEF0F24A18740A0200116B61 /* MGSplitViewController */ = {
Expand Down Expand Up @@ -1061,7 +1045,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
DE485DDB1881D67500B215C6 /* default_avatar.jpg in Resources */,
DEF0F23218727EA700116B61 /* Localizable.strings in Resources */,
DEF0F23B1872C3AC00116B61 /* settings_defaults.plist in Resources */,
DE3AC65C187B63D3007540A9 /* Localizable.strings in Resources */,
Expand Down Expand Up @@ -1146,7 +1129,6 @@
DEFFDE58186E270900E26423 /* AFNetworkActivityIndicatorManager.m in Sources */,
DEF0F2251871EEAD00116B61 /* SQUDistrictAISD.m in Sources */,
DE485DE31881FAC700B215C6 /* SQUUserSwitcherCell.m in Sources */,
DEF0F1C5186EEB9500116B61 /* UIView+JMNoise.m in Sources */,
DEFFDE5E186E270900E26423 /* UIWebView+AFNetworking.m in Sources */,
DEF0F1CB186F7D8F00116B61 /* SQUClassDetailController.m in Sources */,
DECFF3CA187B444B007AFE6D /* SQUCycle.m in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "default_avatar@2x.png"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
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 QuickHAC/QuickHAC/QuickHAC-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>762</string>
<string>77E</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIBackgroundModes</key>
Expand Down
1 change: 0 additions & 1 deletion QuickHAC/QuickHAC/SQUClassDetailController.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#import "SQUColourScheme.h"
#import "SQUClassDetailCell.h"

#import "UIView+JMNoise.h"
#import "PKRevealController.h"
#import "AFNetworking.h"
#import "WYPopoverController.h"
Expand Down
7 changes: 5 additions & 2 deletions QuickHAC/QuickHAC/SQUDistrictManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,6 @@ - (void) performAveragesRequestWithCallback:(SQUDistrictCallback) callback {
[SQUGradeManager sharedInstance].student.school = studentSchool;

[_currentDistrict updateDistrictStateWithClassGrades:averages];

callback(nil, averages);

// Update the display name
NSArray *components = [studentName componentsSeparatedByString:@", "];
Expand All @@ -372,6 +370,11 @@ - (void) performAveragesRequestWithCallback:(SQUDistrictCallback) callback {
} else {
[SQUGradeManager sharedInstance].student.display_name = studentName;
}

// NSLog(@"Updated grades for %@ (%@)", [SQUGradeManager sharedInstance].student.name, [SQUGradeManager sharedInstance].student.display_name);

// Run the callback now to appease login process
callback(nil, averages);
} else {
callback([NSError errorWithDomain:@"SQUDistrictManagerErrorDomain" code:kSQUDistrictManagerErrorInvalidDataReceived userInfo:@{@"localizedDescription" : NSLocalizedString(@"The gradebook returned invalid data.", nil)}], nil);
// NSLog(@"Got screwy response from gradebook: %@", [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding]);
Expand Down
1 change: 0 additions & 1 deletion QuickHAC/QuickHAC/SQUGradeOverviewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

#import "UIViewController+PKRevealController.h"
#import "PKRevealController.h"
#import "UIView+JMNoise.h"
#import "AFNetworking.h"

@implementation SQUGradeOverviewController
Expand Down
36 changes: 29 additions & 7 deletions QuickHAC/QuickHAC/SQULoginViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ - (UITableViewCell *) tableView:(UITableView *) tableView cellForRowAtIndexPath:
_textView.adjustsFontSizeToFitWidth = YES;
_textView.minimumFontSize = 12;

_textView.attributedPlaceholder = [[NSAttributedString alloc] initWithString:NSLocalizedString(@"Username", @"login view controller placeholder") attributes:@{NSForegroundColorAttributeName: UIColorFromRGB(kSQUColourTitle)}];
_textView.attributedPlaceholder = [[NSAttributedString alloc] initWithString:NSLocalizedString(@"Username", @"login view controller placeholder") attributes:@{NSForegroundColorAttributeName: UIColorFromRGB(kSQUColourAsbestos)}];

_usernameField = _textView;
} else if(indexPath.row == 1) {
Expand All @@ -184,7 +184,7 @@ - (UITableViewCell *) tableView:(UITableView *) tableView cellForRowAtIndexPath:
_textView.adjustsFontSizeToFitWidth = YES;
_textView.minimumFontSize = 12;

_textView.attributedPlaceholder = [[NSAttributedString alloc] initWithString:NSLocalizedString(@"Password", @"login view controller placeholder") attributes:@{NSForegroundColorAttributeName: UIColorFromRGB(kSQUColourTitle)}];
_textView.attributedPlaceholder = [[NSAttributedString alloc] initWithString:NSLocalizedString(@"Password", @"login view controller placeholder") attributes:@{NSForegroundColorAttributeName: UIColorFromRGB(kSQUColourAsbestos)}];

_passField = _textView;
}
Expand Down Expand Up @@ -333,18 +333,25 @@ - (void) performAuthentication:(id) sender {
// Set district so login may occurr
[[SQUDistrictManager sharedInstance] selectDistrictWithID:_district.district_id];

__block SQUStudent *oldStudent = [SQUGradeManager sharedInstance].student;

// Ask the current district instance to do a log in
[[SQUDistrictManager sharedInstance] performLoginRequestWithUser:_usernameField.text usingPassword:_passField.text andCallback:^(NSError *error, id returnData){
if(!error) {
if(!returnData) {
[SVProgressHUD showErrorWithStatus:NSLocalizedString(@"Wrong Credentials", nil)];

// Restore old student state
if(oldStudent) {
[[SQUDistrictManager sharedInstance] selectDistrictWithID:oldStudent.district.integerValue];
[[SQUGradeManager sharedInstance] setStudent:oldStudent];
}
} else {
[SVProgressHUD showProgress:-1 status:NSLocalizedString(@"Adding students", nil) maskType:SVProgressHUDMaskTypeGradient];
// Store the username's password in the keychain
[Lockbox setString:_passField.text forKey:_usernameField.text];

// Back up the old student as we need a temporary switch to retrieve data
SQUStudent *oldStudent = [SQUGradeManager sharedInstance].student;
__unsafe_unretained __block SQULoginViewController *self_unsafe = self;

// Set up login function
Expand All @@ -355,7 +362,7 @@ - (void) performAuthentication:(id) sender {
NSLog(@"fetching grades for: %@", [SQUGradeManager sharedInstance].student.name);

// Fetch grades
[[SQUGradeManager sharedInstance] fetchNewClassGradesFromServerWithDoneCallback:^(NSError *error) {
[[SQUGradeManager sharedInstance] fetchNewClassGradesFromServerWithDoneCallback:^(NSError *error) {
if(!error) {
[SVProgressHUD showSuccessWithStatus:NSLocalizedString(@"Done", nil)];

Expand Down Expand Up @@ -421,15 +428,22 @@ - (void) performAuthentication:(id) sender {
picker.delegate = self;
[self.navigationController pushViewController:picker animated:YES];
} else if(![SQUDistrictManager sharedInstance].currentDistrict.hasMultipleStudents && !oldStudent) {
[[NSUserDefaults standardUserDefaults] setInteger:0 forKey:@"selectedStudent"];
[[NSUserDefaults standardUserDefaults] synchronize];

// No previous students and not multistudent account
[[SQUGradeManager sharedInstance] changeSelectedStudent:_students[0]];
[[SQUGradeManager sharedInstance] setStudent:_students[0]];

_studentLoginFunction();
} else {
// There exists a previous student(s), and this account does not have multistudent

// Perform fetch for this student to gather some info about them
if(![SQUDistrictManager sharedInstance].currentDistrict.hasMultipleStudents) {
// this is so the student data goes to the right student
SQUStudent *theStudent = _students[0];
theStudent.name = nil;
theStudent.display_name = nil;
[[SQUGradeManager sharedInstance] setStudent:theStudent];

[SVProgressHUD showProgress:-1 status:NSLocalizedString(@"Updating Grades", nil) maskType:SVProgressHUDMaskTypeGradient];

// Fetch grades
Expand Down Expand Up @@ -480,6 +494,14 @@ - (void) performAuthentication:(id) sender {

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error Authenticating", nil) message:error.localizedDescription delegate:nil cancelButtonTitle:NSLocalizedString(@"Dismiss", nil) otherButtonTitles:nil];
[alert show];

// Restore old student state
if(oldStudent) {
NSLog(@"Restoring student: %@", oldStudent);

[[SQUDistrictManager sharedInstance] selectDistrictWithID:oldStudent.district.integerValue];
[[SQUGradeManager sharedInstance] setStudent:oldStudent];
}
}
}];
}
Expand Down
2 changes: 2 additions & 0 deletions QuickHAC/QuickHAC/SQUSettingsGPAOptionsController.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ - (id) init {
[section addElement:toggle];
}

section.footer = NSLocalizedString(@"These courses will not be counted towards weighted GPA.", nil);

[root addSection:section];
self.root = root;

Expand Down
30 changes: 15 additions & 15 deletions QuickHAC/QuickHAC/SQUSettingsStudents.m
Original file line number Diff line number Diff line change
Expand Up @@ -147,25 +147,25 @@ - (void) tableView:(UITableView *) tableView commitEditingStyle:(UITableViewCell

// Delete object from DB
[[SQUAppDelegate sharedDelegate].managedObjectContext deleteObject:_students[indexPath.row]];
[_students removeObjectAtIndex:indexPath.row];
[_students removeObject:_students[indexPath.row]];

// Do animate-y thing
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];

// Update selection, if we are deleting the selected student
if(indexPath.row == selectedStudent) {
if(selectedStudent < _students.count) {
[[SQUGradeManager sharedInstance] changeSelectedStudent:_students[selectedStudent]];
} else if(selectedStudent == 0 && _students.count != 0) {
[[SQUGradeManager sharedInstance] changeSelectedStudent:_students[0]];
} else if(selectedStudent >= _students.count) {
[[SQUGradeManager sharedInstance] changeSelectedStudent:_students[selectedStudent--]];
} else if(_students.count == 0) {
NSLog(@"all students deleted");
} else {
NSAssert(false, @"Unhandled student deletion case");
}
[[SQUGradeManager sharedInstance] changeSelectedStudent:_students[0]];

// Set default student
SQUStudent *student = _students[0];
[[SQUDistrictManager sharedInstance] selectDistrictWithID:student.district.integerValue];
[[SQUGradeManager sharedInstance] setStudent:student];

// Update UI
[[NSNotificationCenter defaultCenter] postNotificationName:SQUGradesDataUpdatedNotification object:nil];
[[NSNotificationCenter defaultCenter] postNotificationName:SQUStudentsUpdatedNotification object:nil];
}

// Do animate-y thing
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];

if(_students.count == 1) {
self.navigationItem.rightBarButtonItem = nil;
[self.tableView setEditing:NO animated:YES];
Expand Down
2 changes: 2 additions & 0 deletions QuickHAC/QuickHAC/SQUSettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,11 @@ - (void)passcodeWasEnteredSuccessfully {
NSLog(@"Passcode entered successful !!!");
}

#ifdef DEBUG
- (void) submitFeedback:(id) sender {
[TestFlight submitFeedback:_feedbackView.text];
[self dismissViewControllerAnimated:YES completion:NULL];
}
#endif

@end
2 changes: 1 addition & 1 deletion QuickHAC/QuickHAC/SQUUserSwitcherView.m
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ - (UICollectionViewCell *) collectionView:(UICollectionView *) collectionView ce
}

[cell setTitle:student.display_name];
[cell setImage:[UIImage imageNamed:@"default_avatar.jpg"]];
[cell setImage:[UIImage imageNamed:@"default_avatar"]];
}

return cell;
Expand Down
4 changes: 3 additions & 1 deletion QuickHAC/assets/about.rtfd/TXT.rtf
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@
\
Have problems with the app? Suggestions? Or just want to talk? Check out {\field{\*\fldinst{HYPERLINK "http://quickhac.com/support"}}{\fldrslt our website.}}\
\
QuickHAC is the most supreme of all applications ever created for checking grades. It\'92s, like, totally legit. And whatnot.}
Quickly and easily view your grades with a mobile app tailored to be simple, intuitive, and beautiful.\
\
QuickHAC currently only supports Austin ISD and Round Rock ISD. Please {\field{\*\fldinst{HYPERLINK "http://quickhac.com/support"}}{\fldrslt contact us}} if you want to see your district added!}

0 comments on commit d1f94f3

Please sign in to comment.