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
This diff is collapsed.
......@@ -14,14 +14,14 @@
@interface ScanBookViewController : CaptuvoScannerController<UITableViewDataSource, UITableViewDelegate>
@property Session *session;
@property UIWebView *webview;
@property (nonatomic) BOOL contScan;
@property (nonatomic) int volume;
@property (weak, nonatomic) IBOutlet UITableView *scannedBookTableView;
//@property (weak, nonatomic) IBOutlet UITextField *txtBookID;
@property (weak, nonatomic) IBOutlet UIButton *finishBtn;
@property (weak, nonatomic) IBOutlet UIWebView *test_view;
@property (weak, nonatomic) IBOutlet UILabel *lblSection;
- (IBAction)unwindFromSettings:(UIStoryboardSegue *)sender;
@property NSMutableArray *scannedBookList;
@property NSString *lastErrorReceived;
- (IBAction)txtChange:(id)sender;
@end
This diff is collapsed.
//
// Section.h
// WAMI
//
// Created by PLUC SeniorDesign on 4/4/15.
// Copyright (c) 2015 BucknellECE_SeniorDesignTeam1. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface Section : NSObject<NSCopying>
@property (strong, nonatomic) NSString *value;
@property (strong, nonatomic) NSString *text;
@property NSUInteger uid;
@end
//
// Section.m
// WAMI
//
// Created by PLUC SeniorDesign on 4/4/15.
// Copyright (c) 2015 BucknellECE_SeniorDesignTeam1. All rights reserved.
//
#import "Section.h"
@implementation Section
- (id)copyWithZone:(NSZone *)zone
{
// Copying code here.
id copy = [[[self class] alloc] init];
if (copy) {
[copy setValue:[self.value copyWithZone:zone]];
[copy setText:[self.text copyWithZone:zone]];
[copy setUid:self.uid];
}
return copy;
}
@end
//
// SectionBuilder.h
// WAMI
//
// Created by PLUC SeniorDesign on 4/4/15.
// Copyright (c) 2015 BucknellECE_SeniorDesignTeam1. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface SectionBuilder : NSObject
+ (NSArray *)sectionsFromJSON:(NSData *)objectNotation error:(NSError **)error;
@end
//
// SectionBuilder.m
// WAMI
//
// Created by PLUC SeniorDesign on 4/4/15.
// Copyright (c) 2015 BucknellECE_SeniorDesignTeam1. All rights reserved.
//
#import "SectionBuilder.h"
#import "Section.h"
@implementation SectionBuilder
+ (NSArray *)sectionsFromJSON:(NSData *)objectNotation error:(NSError **)error
{
NSError *localError = nil;
NSDictionary *parsedObject = [NSJSONSerialization JSONObjectWithData:objectNotation options:0 error:&localError];
if (localError != nil) {
*error = localError;
return nil;
}
NSMutableArray *sections = [[NSMutableArray alloc] init];
NSArray *results = [parsedObject valueForKey:@"options"];
NSUInteger count = 0;
for (NSDictionary *sectionDic in results) {
Section *section = [[Section alloc] init];
for (NSString *key in sectionDic) {
if ([section respondsToSelector:NSSelectorFromString(key)]) {
[section setValue:[sectionDic valueForKey:key] forKey:key];
}
}
section.uid = count;
count++;
[sections addObject:section];
}
return sections;
}
@end
This diff is collapsed.
......@@ -10,9 +10,6 @@
@implementation Session
-(void) incrementNumScanned {
self.numScanned ++;
}
......
......@@ -25,12 +25,7 @@
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
NSUserDefaults *preferences = [NSUserDefaults standardUserDefaults];
[self.switchContScan setOn:[preferences boolForKey:@"switchOnOff"]];
BatteryStatus battery_status = [[Captuvo sharedCaptuvoDevice] getBatteryStatus];
[self displayBatteryStatusIcon:battery_status];