Commit ab795a3b authored by Alex Moore's avatar Alex Moore

big update, bug fixes and accessibility changes

parent 07600fc5
......@@ -9,6 +9,8 @@
/* Begin PBXBuildFile section */
EF0F973F1ACA61C5008D8416 /* BookBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = EF0F973E1ACA61C5008D8416 /* BookBuilder.m */; };
EF0F97411ACA7003008D8416 /* Book.m in Sources */ = {isa = PBXBuildFile; fileRef = EF0F97401ACA7003008D8416 /* Book.m */; };
EF18373F1AD07C5000E427A7 /* Section.m in Sources */ = {isa = PBXBuildFile; fileRef = EF18373E1AD07C5000E427A7 /* Section.m */; };
EF1837421AD07C6100E427A7 /* SectionBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = EF1837411AD07C6100E427A7 /* SectionBuilder.m */; };
EFDA4ED31ABFC128002B9CEC /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = EFDA4ED21ABFC128002B9CEC /* main.m */; };
EFDA4EDE1ABFC128002B9CEC /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EFDA4EDD1ABFC128002B9CEC /* Images.xcassets */; };
EFDA4EE11ABFC128002B9CEC /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = EFDA4EDF1ABFC128002B9CEC /* LaunchScreen.xib */; };
......@@ -70,6 +72,10 @@
EF0F973D1ACA61C5008D8416 /* BookBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BookBuilder.h; sourceTree = "<group>"; };
EF0F973E1ACA61C5008D8416 /* BookBuilder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BookBuilder.m; sourceTree = "<group>"; };
EF0F97401ACA7003008D8416 /* Book.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Book.m; sourceTree = "<group>"; };
EF18373D1AD07C4F00E427A7 /* Section.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Section.h; sourceTree = "<group>"; };
EF18373E1AD07C5000E427A7 /* Section.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Section.m; sourceTree = "<group>"; };
EF1837401AD07C6100E427A7 /* SectionBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SectionBuilder.h; sourceTree = "<group>"; };
EF1837411AD07C6100E427A7 /* SectionBuilder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SectionBuilder.m; sourceTree = "<group>"; };
EFDA4ECD1ABFC128002B9CEC /* WAMI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WAMI.app; sourceTree = BUILT_PRODUCTS_DIR; };
EFDA4ED11ABFC128002B9CEC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
EFDA4ED21ABFC128002B9CEC /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
......@@ -151,6 +157,87 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
EF1837351AD061A300E427A7 /* View Controllers */ = {
isa = PBXGroup;
children = (
EF1837391AD062B600E427A7 /* Header Files */,
EFDA4F431ABFC211002B9CEC /* LogInViewController.m */,
EFDA4F451ABFC211002B9CEC /* SectionViewController.m */,
EFDA4F441ABFC211002B9CEC /* ScanBookViewController.m */,
EFDA4F471ABFC211002B9CEC /* SettingsViewController.m */,
);
name = "View Controllers";
sourceTree = "<group>";
};
EF1837361AD061B500E427A7 /* Captuvo Controllers */ = {
isa = PBXGroup;
children = (
EF18373A1AD062C200E427A7 /* Header Files */,
EFDA4F411ABFC211002B9CEC /* CaptuvoViewController.m */,
EFDA4F3F1ABFC211002B9CEC /* CaptuvoOptionsController.m */,
EFDA4F401ABFC211002B9CEC /* CaptuvoScannerController.m */,
);
name = "Captuvo Controllers";
sourceTree = "<group>";
};
EF1837381AD0623600E427A7 /* Miscellaneous */ = {
isa = PBXGroup;
children = (
EF18373B1AD062C900E427A7 /* Header Files */,
EF0F97401ACA7003008D8416 /* Book.m */,
EF0F973E1ACA61C5008D8416 /* BookBuilder.m */,
EFDA4F421ABFC211002B9CEC /* GlobalWebController.m */,
EF18373E1AD07C5000E427A7 /* Section.m */,
EF1837411AD07C6100E427A7 /* SectionBuilder.m */,
EFDA4F461ABFC211002B9CEC /* Session.m */,
);
name = Miscellaneous;
sourceTree = "<group>";
};
EF1837391AD062B600E427A7 /* Header Files */ = {
isa = PBXGroup;
children = (
EFDA4F381ABFC1ED002B9CEC /* LogInViewController.h */,
EFDA4F3A1ABFC1ED002B9CEC /* SectionViewController.h */,
EFDA4F391ABFC1ED002B9CEC /* ScanBookViewController.h */,
EFDA4F3C1ABFC1ED002B9CEC /* SettingsViewController.h */,
);
name = "Header Files";
sourceTree = "<group>";
};
EF18373A1AD062C200E427A7 /* Header Files */ = {
isa = PBXGroup;
children = (
EFDA4F331ABFC1ED002B9CEC /* Captuvo.h */,
EFDA4F361ABFC1ED002B9CEC /* CaptuvoViewController.h */,
EFDA4F341ABFC1ED002B9CEC /* CaptuvoOptionsController.h */,
EFDA4F351ABFC1ED002B9CEC /* CaptuvoScannerController.h */,
);
name = "Header Files";
sourceTree = "<group>";
};
EF18373B1AD062C900E427A7 /* Header Files */ = {
isa = PBXGroup;
children = (
EF0F973A1ACA604B008D8416 /* Book.h */,
EF0F973D1ACA61C5008D8416 /* BookBuilder.h */,
EFDA4F371ABFC1ED002B9CEC /* GlobalWebController.h */,
EF18373D1AD07C4F00E427A7 /* Section.h */,
EF1837401AD07C6100E427A7 /* SectionBuilder.h */,
EFDA4F3B1ABFC1ED002B9CEC /* Session.h */,
);
name = "Header Files";
sourceTree = "<group>";
};
EF18373C1AD062DE00E427A7 /* Header Files */ = {
isa = PBXGroup;
children = (
EFDA4F321ABFC1ED002B9CEC /* AppDelegate.h */,
EFDA4F3D1ABFC1ED002B9CEC /* WebViewController.h */,
);
name = "Header Files";
sourceTree = "<group>";
};
EFDA4EC41ABFC127002B9CEC = {
isa = PBXGroup;
children = (
......@@ -173,7 +260,6 @@
isa = PBXGroup;
children = (
EFDA4F561ABFC232002B9CEC /* Main.storyboard */,
EFDA4F131ABFC15B002B9CEC /* Include */,
EFDA4F141ABFC161002B9CEC /* Source */,
EFDA4F151ABFC166002B9CEC /* Libraries */,
EFDA4F121ABFC155002B9CEC /* JavaScript */,
......@@ -232,43 +318,15 @@
name = JavaScript;
sourceTree = "<group>";
};
EFDA4F131ABFC15B002B9CEC /* Include */ = {
isa = PBXGroup;
children = (
EFDA4F321ABFC1ED002B9CEC /* AppDelegate.h */,
EF0F973A1ACA604B008D8416 /* Book.h */,
EF0F973D1ACA61C5008D8416 /* BookBuilder.h */,
EFDA4F331ABFC1ED002B9CEC /* Captuvo.h */,
EFDA4F341ABFC1ED002B9CEC /* CaptuvoOptionsController.h */,
EFDA4F351ABFC1ED002B9CEC /* CaptuvoScannerController.h */,
EFDA4F361ABFC1ED002B9CEC /* CaptuvoViewController.h */,
EFDA4F371ABFC1ED002B9CEC /* GlobalWebController.h */,
EFDA4F381ABFC1ED002B9CEC /* LogInViewController.h */,
EFDA4F391ABFC1ED002B9CEC /* ScanBookViewController.h */,
EFDA4F3A1ABFC1ED002B9CEC /* SectionViewController.h */,
EFDA4F3B1ABFC1ED002B9CEC /* Session.h */,
EFDA4F3C1ABFC1ED002B9CEC /* SettingsViewController.h */,
EFDA4F3D1ABFC1ED002B9CEC /* WebViewController.h */,
);
name = Include;
sourceTree = "<group>";
};
EFDA4F141ABFC161002B9CEC /* Source */ = {
isa = PBXGroup;
children = (
EF18373C1AD062DE00E427A7 /* Header Files */,
EFDA4F3E1ABFC211002B9CEC /* AppDelegate.m */,
EF0F97401ACA7003008D8416 /* Book.m */,
EF0F973E1ACA61C5008D8416 /* BookBuilder.m */,
EFDA4F3F1ABFC211002B9CEC /* CaptuvoOptionsController.m */,
EFDA4F401ABFC211002B9CEC /* CaptuvoScannerController.m */,
EFDA4F411ABFC211002B9CEC /* CaptuvoViewController.m */,
EFDA4F421ABFC211002B9CEC /* GlobalWebController.m */,
EFDA4F431ABFC211002B9CEC /* LogInViewController.m */,
EFDA4F441ABFC211002B9CEC /* ScanBookViewController.m */,
EFDA4F451ABFC211002B9CEC /* SectionViewController.m */,
EFDA4F461ABFC211002B9CEC /* Session.m */,
EFDA4F471ABFC211002B9CEC /* SettingsViewController.m */,
EFDA4F481ABFC211002B9CEC /* WebViewController.m */,
EF1837351AD061A300E427A7 /* View Controllers */,
EF1837361AD061B500E427A7 /* Captuvo Controllers */,
EF1837381AD0623600E427A7 /* Miscellaneous */,
);
name = Source;
sourceTree = "<group>";
......@@ -436,10 +494,12 @@
EFDA4F4D1ABFC211002B9CEC /* GlobalWebController.m in Sources */,
EFDA4F491ABFC211002B9CEC /* AppDelegate.m in Sources */,
EFDA4F511ABFC211002B9CEC /* Session.m in Sources */,
EF1837421AD07C6100E427A7 /* SectionBuilder.m in Sources */,
EF0F973F1ACA61C5008D8416 /* BookBuilder.m in Sources */,
EFDA4F531ABFC211002B9CEC /* WebViewController.m in Sources */,
EFDA4F4B1ABFC211002B9CEC /* CaptuvoScannerController.m in Sources */,
EFDA4F521ABFC211002B9CEC /* SettingsViewController.m in Sources */,
EF18373F1AD07C5000E427A7 /* Section.m in Sources */,
EFDA4F4A1ABFC211002B9CEC /* CaptuvoOptionsController.m in Sources */,
EF0F97411ACA7003008D8416 /* Book.m in Sources */,
EFDA4ED31ABFC128002B9CEC /* main.m in Sources */,
......@@ -559,6 +619,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
"GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS[arch=*]" = TESTING;
INFOPLIST_FILE = WAMI/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
......
......@@ -18,7 +18,7 @@
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
//NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
return YES;
}
......@@ -26,6 +26,7 @@
- (void)applicationWillResignActive:(UIApplication *)application {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
......@@ -38,11 +39,12 @@
- (void)applicationWillEnterForeground:(UIApplication *)application {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
[[Captuvo sharedCaptuvoDevice] startDecoderHardware] ;
[[Captuvo sharedCaptuvoDevice] startPMHardware] ;
[[Captuvo sharedCaptuvoDevice] startPMHardware];
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
}
- (void)applicationWillTerminate:(UIApplication *)application {
......
......@@ -24,7 +24,6 @@
NSMutableArray *books = [[NSMutableArray alloc] init];
NSArray *results = [parsedObject valueForKey:@"books"];
NSLog(@"Count %lu", (unsigned long)results.count);
for (NSDictionary *bookDic in results) {
Book *book = [[Book alloc] init];
......
......@@ -13,5 +13,6 @@
@property (weak, nonatomic) IBOutlet UIStepper *sledSoundStepper;
@property (weak, nonatomic) IBOutlet UILabel *sledSoundLabel;
@property (weak, nonatomic) IBOutlet UIImageView *batteryView;
@property (strong, nonatomic) IBOutlet UISlider *volumeSlider;
@end
......@@ -54,6 +54,7 @@ int sled_volume;
break;
}
self.sledSoundStepper.value = (double)sled_volume;
self.volumeSlider.value = sled_volume;
}
/**
......@@ -86,6 +87,32 @@ int sled_volume;
}
}
- (IBAction)changeSledVolumeSlider:(id)sender {
sled_volume = (int)lroundf(self.volumeSlider.value);
[self.volumeSlider setValue:sled_volume animated:YES];
switch (sled_volume) {
case 0:
[[Captuvo sharedCaptuvoDevice] setDecoderGoodReadBeeperVolume:BeeperVolumeOff persistSetting:YES];
self.sledSoundLabel.text = @"Silent";
break;
case 1:
[[Captuvo sharedCaptuvoDevice] setDecoderGoodReadBeeperVolume:BeeperVolumeLow persistSetting:YES];
self.sledSoundLabel.text = @"Low";
break;
case 2:
[[Captuvo sharedCaptuvoDevice] setDecoderGoodReadBeeperVolume:BeeperVolumeMedium persistSetting:YES];
self.sledSoundLabel.text = @"Medium";
break;
case 3:
[[Captuvo sharedCaptuvoDevice] setDecoderGoodReadBeeperVolume:BeeperVolumeHigh persistSetting:YES];
self.sledSoundLabel.text = @"High";
break;
default:
break;
}
}
/*
#pragma mark - Navigation
......
......@@ -17,12 +17,12 @@
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[self initDecoder];
}
-(void) viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[self initDecoder];
}
- (void)didReceiveMemoryWarning {
......@@ -97,8 +97,6 @@
// codabarOptions.minMessageLength = 4;
// codabarOptions.maxMessageLength = 60;
// [[Captuvo sharedCaptuvoDevice] setDecoderCodabarConfiguration:codabarOptions persistSetting:NO];
[[Captuvo sharedCaptuvoDevice] setDecoderGoodReadDelayInMilliSeconds:2000 persistSetting:YES];
}
......
......@@ -18,7 +18,7 @@
@property(nonatomic, retain) UIWebView *web;
@property(nonatomic, assign) bool isInitialized;
+(GlobalWebController*) getInstance;
+(GlobalWebController*) resetInstance;
+ (GlobalWebController*)getInstance;
+ (GlobalWebController*)resetInstance;
@end
......@@ -14,7 +14,7 @@
static GlobalWebController *instance = nil;
+(GlobalWebController*) getInstance
+ (GlobalWebController*)getInstance
{
@synchronized(self)
{
......@@ -25,7 +25,7 @@ static GlobalWebController *instance = nil;
}
return instance;
}
+(GlobalWebController*) resetInstance
+ (GlobalWebController*)resetInstance
{
@synchronized(self)
{
......
......@@ -13,6 +13,8 @@
@property (weak, nonatomic, readonly) UIButton *btnLogIn;
@property (weak, nonatomic, readwrite) UITextField *txtUsername;
@property (weak, nonatomic, readwrite) UITextField *txtPassword;
@property (weak, nonatomic) IBOutlet UISwitch *rememberUsernameSwitch;
@property (weak, nonatomic) IBOutlet UISwitch *rememberPasswordSwitch;
- (IBAction)btnLogInTouch:(id)sender;
@end
......@@ -21,94 +21,69 @@
self.navigationItem.hidesBackButton = YES;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[self resetRTI];
[self checkAndSatisfyUserLoginPreferences];
}
- (void)webViewDidFinishLoad:(UIWebView *)webView {
NSString *url = [[self.webview request] URL].absoluteString;
NSString *base_dest_url;
#ifdef TESTING
base_dest_url = @"http://162.223.19.75";
#else
base_dest_url = @"http://192.168.1.131";
#endif
if ([url isEqualToString:[base_dest_url stringByAppendingString:@"/rti/"]]
|| [url isEqualToString:[base_dest_url stringByAppendingString:@"/rti/RTILogin.aspx"]]) {
NSLog(@"1: %@", url);
}
else if ([url isEqualToString:[base_dest_url stringByAppendingString:@"/rti/RTISetup.aspx?location=1"]]) {
NSLog(@"2: %@", url);
[self performSegueWithIdentifier:@"segueLogIn" sender:nil];
}
//Page handles username/password errors; now handle deeper errors
else {
NSLog(@"3: %@", url);
/*
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"FATAL PAGE ERROR" message:@"Page not recognized, cannot proceed. App will no longer work as expected." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[alert show];
*/
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"FATAL PAGE ERROR" message:@"Page not recognized, cannot proceed. App will no longer work as expected." preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *ok = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
[alert dismissViewControllerAnimated:YES completion:nil];
}];
[alert addAction: ok];
[self presentViewController:alert animated:YES completion:nil];
}
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
[self evaluateNextRTIAction:webView];
}
//allow app to flip to upside down
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
if (toInterfaceOrientation == UIInterfaceOrientationPortrait)
return YES;
if (toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown)
return YES;
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft)
return NO;
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
return NO;
return NO; // Unknown value
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
-(BOOL)shouldAutorotate {
return YES;
- (IBAction)prepareForUnwindToLogin:(UIStoryboardSegue *)sender {
}
-(NSUInteger)supportedInterfaceOrientations {
return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown);
}
#pragma mark - Helper Functions
-(IBAction)unwindFromSection:(UIStoryboardSegue *)sender {
- (void)checkAndSatisfyUserLoginPreferences {
}
-(IBAction)unwindFromScan:(UIStoryboardSegue *)sender {
self.txtPassword.text = @"";
self.txtUsername.text = @"";
//Set switches, username, password
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
if ([prefs boolForKey:@"rememberUsername"]) {
[self.rememberUsernameSwitch setOn:YES];
self.txtUsername.text = [[NSUserDefaults standardUserDefaults] stringForKey:@"usernameString"];
}
if ([prefs boolForKey:@"rememberPassword"]) {
[self.rememberPasswordSwitch setOn:YES];
self.txtPassword.text = [[NSUserDefaults standardUserDefaults] stringForKey:@"passwordString"];
}
}
-(void) resetRTI {
- (void)resetRTI {
//Remove delegate from webview
[self.webview setDelegate:nil];
//Reset global uiwebview
GlobalWebController *globalWeb = [GlobalWebController resetInstance];
//Create new uiwebview
self.webview = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
//Set global uiwebview = new uiwebview, mark as initialized
globalWeb.web = self.webview;
globalWeb.isInitialized = true;
//Set current view as delegate of uiwebview
[self.webview setDelegate:self];
//Create URL request for RTI webpage
NSURLRequest *rti;
#ifdef TESTING
......@@ -133,17 +108,63 @@
[self.view addSubview:self.webview];
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
- (void)evaluateNextRTIAction:(UIWebView *)webView {
NSString *url = [[webView request] URL].absoluteString;
NSString *base_dest_url;
#ifdef TESTING
base_dest_url = @"http://162.223.19.75";
#else
base_dest_url = @"http://192.168.1.131";
#endif
if ([url isEqualToString:[base_dest_url stringByAppendingString:@"/rti/"]]) {
NSLog(@"0: %@", url);
}
else if ([url isEqualToString:[base_dest_url stringByAppendingString:@"/rti/RTILogin.aspx"]]) {
NSLog(@"1: %@", url);
}
else if ([url isEqualToString:[base_dest_url stringByAppendingString:@"/rti/RTISetup.aspx?location=1"]]) {
NSLog(@"2: %@", url);
//Remember username/password if desired
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
if ([prefs boolForKey:@"rememberUsername"]) {
[prefs setValue:self.txtUsername.text forKey:@"usernameString"];
}
else {
[prefs setValue:@"" forKey:@"usernameString"];
}
[prefs synchronize];
if ([prefs boolForKey:@"rememberPassword"]) {
[prefs setValue:self.txtPassword.text forKey:@"passwordString"];
}
else {
[prefs setValue:@"" forKey:@"passwordString"];
}
[prefs synchronize];
//Segue to section page
[self performSegueWithIdentifier:@"segueLoginToSection" sender:nil];
}
//Page handles username/password errors; now handle deeper errors
else {
NSLog(@"3: %@", url);
/*
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"FATAL PAGE ERROR" message:@"Page not recognized, cannot proceed. App will no longer work as expected." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[alert show];
*/
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"FATAL PAGE ERROR" message:@"Page not recognized, cannot proceed. App will no longer work as expected." preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *ok = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
[alert dismissViewControllerAnimated:YES completion:nil];
}];
[alert addAction: ok];
[self presentViewController:alert animated:YES completion:nil];
}
}
*/
#pragma mark - UI Buttons
- (IBAction)btnLogInTouch:(id)sender {
......@@ -168,6 +189,15 @@
NSString *login = [login1 stringByAppendingString:[username stringByAppendingString:[password stringByAppendingString:login2]]];
[self.webview stringByEvaluatingJavaScriptFromString:login];
}
- (IBAction)rememberUsernameBtnChanged:(id)sender {
[[NSUserDefaults standardUserDefaults] setBool:self.rememberUsernameSwitch.isOn forKey:@"rememberUsername"];
[[NSUserDefaults standardUserDefaults] synchronize];
}
- (IBAction)rememberPasswordBtnChanged:(id)sender {
[[NSUserDefaults standardUserDefaults] setBool:self.rememberPasswordSwitch.isOn forKey:@"rememberPassword"];
[[NSUserDefaults standardUserDefaults] synchronize];
}
@end
......@@ -54,36 +54,70 @@
<navigationItem title="Inventory Log-In" id="4Dp-YT-MRf"/>
</items>
</navigationBar>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="IYZ-Af-OWK">
<rect key="frame" x="223" y="352" width="51" height="31"/>
<connections>
<action selector="rememberPasswordBtnChanged:" destination="BYZ-38-t0r" eventType="valueChanged" id="EFe-ys-vsN"/>
</connections>
</switch>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Remember Username" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Wg4-Jj-Qu2">
<rect key="frame" x="16" y="318" width="168" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Remember Password" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uxO-hd-8cT">
<rect key="frame" x="16" y="357" width="165" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="jIg-lr-y4q">
<rect key="frame" x="223" y="313" width="51" height="31"/>
<connections>
<action selector="rememberUsernameBtnChanged:" destination="BYZ-38-t0r" eventType="valueChanged" id="zWq-ZI-h8E"/>
</connections>
</switch>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="1dA-Bp-AXg" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" id="1Iv-ts-bxe"/>
<constraint firstItem="rFc-Xp-Oik" firstAttribute="top" secondItem="TTD-gb-lM9" secondAttribute="bottom" constant="84" id="BZN-PO-w4E"/>
<constraint firstItem="TTD-gb-lM9" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" constant="8" id="I9t-6P-DtG"/>
<constraint firstItem="tJE-yf-FhY" firstAttribute="top" secondItem="1dA-Bp-AXg" secondAttribute="bottom" constant="40" id="INL-Jl-D2V"/>
<constraint firstItem="rFc-Xp-Oik" firstAttribute="trailing" secondItem="u4E-6x-G9M" secondAttribute="trailing" id="Odo-8G-1rD"/>
<constraint firstAttribute="trailing" secondItem="TTD-gb-lM9" secondAttribute="trailing" id="SMU-ZS-LjP"/>
<constraint firstItem="u4E-6x-G9M" firstAttribute="trailing" secondItem="rr9-HZ-Pee" secondAttribute="trailing" id="UTT-kZ-vUg"/>
<constraint firstItem="rFc-Xp-Oik" firstAttribute="leading" secondItem="u4E-6x-G9M" secondAttribute="leading" id="ZPV-Ud-12J"/>
<constraint firstItem="tJE-yf-FhY" firstAttribute="leading" secondItem="1dA-Bp-AXg" secondAttribute="leading" id="Zfu-Ad-NS1"/>
<constraint firstItem="rFc-Xp-Oik" firstAttribute="trailing" secondItem="8bC-Xf-vdC" secondAttribute="trailingMargin" id="Zgw-YO-s0e"/>
<constraint firstItem="rr9-HZ-Pee" firstAttribute="top" secondItem="u4E-6x-G9M" secondAttribute="bottom" constant="8" symbolic="YES" id="ccd-bI-2Mm"/>
<constraint firstItem="u4E-6x-G9M" firstAttribute="bottom" secondItem="tJE-yf-FhY" secondAttribute="bottom" id="iXp-oe-fIk"/>
<constraint firstItem="u4E-6x-G9M" firstAttribute="top" secondItem="rFc-Xp-Oik" secondAttribute="bottom" constant="26" id="lZ2-B3-rTj"/>
<constraint firstItem="rFc-Xp-Oik" firstAttribute="leading" secondItem="1dA-Bp-AXg" secondAttribute="trailing" constant="15" id="rxR-ng-ItO"/>
<constraint firstItem="TTD-gb-lM9" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="v6X-UK-apY"/>
<constraint firstAttribute="trailing" secondItem="TTD-gb-lM9" secondAttribute="trailing" id="049-xX-0XW"/>
<constraint firstItem="IYZ-Af-OWK" firstAttribute="centerY" secondItem="uxO-hd-8cT" secondAttribute="centerY" id="0bD-a2-qJT"/>
<constraint firstItem="jIg-lr-y4q" firstAttribute="leading" secondItem="IYZ-Af-OWK" secondAttribute="leading" id="5zr-dI-Ewu"/>
<constraint firstItem="uxO-hd-8cT" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" id="COx-h7-8u2"/>
<constraint firstItem="1dA-Bp-AXg" firstAttribute="leading" secondItem="tJE-yf-FhY" secondAttribute="leading" id="JEQ-u5-BEY"/>
<constraint firstItem="rFc-Xp-Oik" firstAttribute="trailing" secondItem="u4E-6x-G9M" secondAttribute="trailing" id="KIK-Oa-0f0"/>
<constraint firstItem="tJE-yf-FhY" firstAttribute="bottom" secondItem="u4E-6x-G9M" secondAttribute="bottom" id="NMM-pH-vUE"/>
<constraint firstItem="rr9-HZ-Pee" firstAttribute="trailing" secondItem="8bC-Xf-vdC" secondAttribute="trailingMargin" id="RgD-7j-8mI"/>
<constraint firstItem="uxO-hd-8cT" firstAttribute="leading" secondItem="Wg4-Jj-Qu2" secondAttribute="leading" id="Sy5-Om-bET"/>
<constraint firstItem="rFc-Xp-Oik" firstAttribute="leading" secondItem="1dA-Bp-AXg" secondAttribute="trailing" constant="15" id="Ue9-Ck-FWp"/>
<constraint firstItem="IYZ-Af-OWK" firstAttribute="top" secondItem="jIg-lr-y4q" secondAttribute="bottom" constant="8" symbolic="YES" id="XIl-ax-EQM"/>
<constraint firstItem="jIg-lr-y4q" firstAttribute="centerY" secondItem="Wg4-Jj-Qu2" secondAttribute="centerY" id="XPH-o0-4aN"/>
<constraint firstItem="rFc-Xp-Oik" firstAttribute="leading" secondItem="u4E-6x-G9M" secondAttribute="leading" id="YoH-RH-fUP"/>
<constraint firstItem="TTD-gb-lM9" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" constant="8" id="cGi-rR-wN8"/>
<constraint firstItem="rr9-HZ-Pee" firstAttribute="top" secondItem="u4E-6x-G9M" secondAttribute="bottom" constant="8" symbolic="YES" id="ccQ-8X-0GO"/>
<constraint firstItem="u4E-6x-G9M" firstAttribute="top" secondItem="rFc-Xp-Oik" secondAttribute="bottom" constant="26" id="dIt-I5-aWe"/>
<constraint firstItem="rFc-Xp-Oik" firstAttribute="top" secondItem="TTD-gb-lM9" secondAttribute="bottom" constant="84" id="kYA-aL-c8V"/>
<constraint firstItem="u4E-6x-G9M" firstAttribute="trailing" secondItem="rr9-HZ-Pee" secondAttribute="trailing" id="lln-g9-fHw"/>
<constraint firstItem="jIg-lr-y4q" firstAttribute="top" secondItem="u4E-6x-G9M" secondAttribute="bottom" constant="71" id="nJR-eU-yJD"/>
<constraint firstItem="jIg-lr-y4q" firstAttribute="leading" secondItem="Wg4-Jj-Qu2" secondAttribute="trailing" constant="39" id="pOU-jk-IQY"/>
<constraint firstItem="tJE-yf-FhY" firstAttribute="top" secondItem="1dA-Bp-AXg" secondAttribute="bottom" constant="40" id="pro-7G-uPM"/>
<constraint firstItem="tJE-yf-FhY" firstAttribute="leading" secondItem="Wg4-Jj-Qu2" secondAttribute="leading" id="sOf-C2-2a0"/>
<constraint firstItem="TTD-gb-lM9" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="zzz-0U-sOd"/>
</constraints>
</view>
<navigationItem key="navigationItem" title="PLUC Inventory Log-In" id="MTF-s9-qJz"/>
<connections>
<outlet property="rememberPasswordSwitch" destination="IYZ-Af-OWK" id="GBs-XC-YPI"/>
<outlet property="rememberUsernameSwitch" destination="jIg-lr-y4q" id="QpB-mO-Ut7"/>
<outlet property="txtPassword" destination="u4E-6x-G9M" id="sbx-w0-Hox"/>
<outlet property="txtUsername" destination="rFc-Xp-Oik" id="Q9Z-xl-cFg"/>
<segue destination="Feu-98-wZh" kind="show" identifier="segueLogIn" id="mO8-qi-2TI"/>
<segue destination="Feu-98-wZh" kind="show" identifier="segueLoginToSection" id="mO8-qi-2TI"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="952" y="136"/>
<point key="canvasLocation" x="948" y="108"/>
</scene>
<!--Inventory Section-->
<scene sceneID="8NC-rw-Ief">
......@@ -97,26 +131,13 @@
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="KQi-KS-V1c">
<rect key="frame" x="0.0" y="61" width="600" height="600"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="ListPrototypeCell" id="Lit-iu-3da">
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Lit-iu-3da" id="sY5-sD-kSW">
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
</prototypes>
</tableView>
<navigationBar contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="56R-bO-Qgb">
<rect key="frame" x="0.0" y="17" width="600" height="44"/>
<items>
<navigationItem title="Inventory Section" id="4Uv-nC-4He">
<barButtonItem key="leftBarButtonItem" title="Exit" id="bBZ-SA-qdk">
<connections>
<segue destination="yp2-94-MGi" kind="unwind" unwindAction="unwindFromSection:" id="2lE-Yv-uou"/>
<action selector="exitBtnPressed:" destination="Feu-98-wZh" id="MKc-sw-sWE"/>
</connections>
</barButtonItem>
<barButtonItem key="rightBarButtonItem" title="Select" id="2p3-0Z-NXG">
......@@ -127,16 +148,29 @@
</navigationItem>
</items>
</navigationBar>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="KQi-KS-V1c">
<rect key="frame" x="0.0" y="61" width="600" height="539"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="ListPrototypeCell" id="Lit-iu-3da">
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Lit-iu-3da" id="sY5-sD-kSW">
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
</prototypes>
</tableView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>