Skip to content

Commit

Permalink
Merge pull request #8 from rob-miller/fix-14.4
Browse files Browse the repository at this point in the history
Fix 14.4
  • Loading branch information
rob-miller authored Apr 15, 2021
2 parents a28b8bd + e000e10 commit 956f5a3
Show file tree
Hide file tree
Showing 89 changed files with 665 additions and 461 deletions.
4 changes: 2 additions & 2 deletions Classes/RootViewController.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************
RootViewController.h
Copyright 2010-2016 Robert T. Miller
Copyright 2010-2021 Robert T. Miller
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -65,7 +65,7 @@

@property (nonatomic,strong) trackerList *tlist;
@property (nonatomic, strong) privacyV *privacyObj;
@property (atomic) int32_t refreshLock;
@property (atomic) _Atomic int32_t refreshLock;
@property (nonatomic) BOOL initialPrefsLoad;
//@property (nonatomic) BOOL openUrlLock;
//@property (nonatomic,retain) NSURL *inputURL;
Expand Down
14 changes: 9 additions & 5 deletions Classes/RootViewController.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************
RootViewController.m
Copyright 2010-2016 Robert T. Miller
Copyright 2010-2021 Robert T. Miller
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -23,7 +23,8 @@
// Copyright Robert T. Miller 2010. All rights reserved.
//

#import <libkern/OSAtomic.h>
// deprecaed ios 10 #import <libkern/OSAtomic.h>
#import <stdatomic.h>

#import "RootViewController.h"
#import "rTrackerAppDelegate.h"
Expand Down Expand Up @@ -1096,7 +1097,8 @@ - (void) handlePrefs {
*/
- (void) refreshView {

if (0 != OSAtomicTestAndSet(0, &(_refreshLock))) {
// deprecated ios 10 - if (0 != OSAtomicTestAndSet(0, &(_refreshLock))) {
if (0 != atomic_fetch_or_explicit(&(_refreshLock), 0, memory_order_relaxed)) {
// wasn't 0 before, so we didn't get lock, so leave because refresh already in process
return;
}
Expand Down Expand Up @@ -1194,10 +1196,11 @@ - (void) fixFileProblem:(NSInteger)choice {
[self viewDidAppearRestart];

}
/*
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
[self fixFileProblem:buttonIndex];
}

*/
- (void) viewDidAppearRestart {
[self refreshView];

Expand Down Expand Up @@ -1508,7 +1511,8 @@ - (void) btnHelp {
#if ADVERSION
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://rob-miller.github.io/rTracker/rTracker/iPhone/replace_rTrackerA.html"]];
#else
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://rob-miller.github.io/rTracker/rTracker/iPhone/userGuide/"]];
//[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://rob-miller.github.io/rTracker/rTracker/iPhone/userGuide/"]]; // deprecated ios 9
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://rob-miller.github.io/rTracker/rTracker/iPhone/userGuide/"] options:@{} completionHandler:nil];
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion Classes/addTrackerController.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************
addTrackerController.h
Copyright 2010-2016 Robert T. Miller
Copyright 2010-2021 Robert T. Miller
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
42 changes: 16 additions & 26 deletions Classes/addTrackerController.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************
addTrackerController.m
Copyright 2010-2016 Robert T. Miller
Copyright 2010-2021 Robert T. Miller
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -487,11 +487,11 @@ - (void) handleCheckValObjDelete:(NSInteger)choice {
self.deleteIndexPath=nil;

}

/*
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
[self handleCheckValObjDelete:buttonIndex];
}

*/

# pragma mark -
# pragma mark Table View Data Source Methods
Expand Down Expand Up @@ -753,29 +753,19 @@ - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEd
NSString *btn0 = @"Cancel";
NSString *btn1 = @"Yes, delete";

if (SYSTEM_VERSION_LESS_THAN(@"8.0")) {
UIAlertView* alert = [[UIAlertView alloc]
initWithTitle:title
message:msg
delegate:self
cancelButtonTitle:btn0
otherButtonTitles: btn1,nil];

[alert show];
} else {
UIAlertController* alert = [UIAlertController alertControllerWithTitle:title
message:msg
preferredStyle:UIAlertControllerStyleAlert];

UIAlertAction* cancelAction = [UIAlertAction actionWithTitle:btn0 style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { [self handleCheckValObjDelete:0]; }];
UIAlertAction* deleteAction = [UIAlertAction actionWithTitle:btn1 style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { [self handleCheckValObjDelete:1]; }];

[alert addAction:cancelAction];
[alert addAction:deleteAction];

[self presentViewController:alert animated:YES completion:nil];

}
UIAlertController* alert = [UIAlertController alertControllerWithTitle:title
message:msg
preferredStyle:UIAlertControllerStyleAlert];

UIAlertAction* cancelAction = [UIAlertAction actionWithTitle:btn0 style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { [self handleCheckValObjDelete:0]; }];
UIAlertAction* deleteAction = [UIAlertAction actionWithTitle:btn1 style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { [self handleCheckValObjDelete:1]; }];

[alert addAction:cancelAction];
[alert addAction:deleteAction];

[self presentViewController:alert animated:YES completion:nil];


}
} else if (editingStyle == UITableViewCellEditingStyleInsert) {
DBGLog(@"atc: insert row %lu ",(unsigned long)row);
Expand Down
2 changes: 1 addition & 1 deletion Classes/addValObjController.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************
addValObjController.h
Copyright 2010-2016 Robert T. Miller
Copyright 2010-2021 Robert T. Miller
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Classes/addValObjController.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************
addValObjController.m
Copyright 2010-2016 Robert T. Miller
Copyright 2010-2021 Robert T. Miller
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Classes/configTVObjVC.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************
configTVObjVC.h
Copyright 2010-2016 Robert T. Miller
Copyright 2010-2021 Robert T. Miller
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
15 changes: 9 additions & 6 deletions Classes/configTVObjVC.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************
configTVObjVC.m
Copyright 2010-2016 Robert T. Miller
Copyright 2010-2021 Robert T. Miller
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -109,11 +109,11 @@ - (UIScrollView*) scroll {
*/

- (void) btnChoiceHelp {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://rob-miller.github.io/rTracker/rTracker/iPhone/QandA/choices.html"]];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://rob-miller.github.io/rTracker/rTracker/iPhone/QandA/choices.html"] options:@{} completionHandler:nil];
}

- (void) btnInfoHelp {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://rob-miller.github.io/rTracker/rTracker/iPhone/QandA/info.html"]];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://rob-miller.github.io/rTracker/rTracker/iPhone/QandA/info.html"] options:@{} completionHandler:nil];
}

- (void)viewDidLoad {
Expand Down Expand Up @@ -858,21 +858,21 @@ - (void) recoverValuesBtn {

}


/*
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (0 != buttonIndex) {
[self recoverValuesBtn];
}
}

*/
- (void) setRemindersBtn {
[self.to reminders2db];
[self.to setReminders];
}

- (void) displayDbInfo {
NSString *titleStr;
[rTracker_resource setNotificationsEnabled];
NSString *sql = @"select count(*) from trkrData";
int dateEntries = [self.to toQry2Int:sql];
sql = @"select count(*) from voData";
Expand Down Expand Up @@ -900,11 +900,14 @@ - (void) displayDbInfo {
[NSDateFormatter localizedStringFromDate:date dateStyle:NSDateFormatterFullStyle timeStyle:NSDateFormatterShortStyle]]];
}

/*
__block UIUserNotificationSettings* uns;
safeDispatchSync(^{
uns = [[UIApplication sharedApplication] currentUserNotificationSettings];
});
if (! ([uns types] & (UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge))) {
*/
if (! [rTracker_resource getNotificationsEnabled]) {
titleStr = [titleStr stringByAppendingString:@"\n\n- Notifications Disabled -\nEnable in System Preferences."];
}

Expand Down
2 changes: 1 addition & 1 deletion Classes/configTlistController.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************
configTlistController.h
Copyright 2010-2016 Robert T. Miller
Copyright 2010-2021 Robert T. Miller
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
50 changes: 20 additions & 30 deletions Classes/configTlistController.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************
configTlistController.m
Copyright 2010-2016 Robert T. Miller
Copyright 2010-2021 Robert T. Miller
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -292,12 +292,12 @@ - (void) handleCheckTrackerDelete:(NSInteger)choice {
self.deleteIndexPath = nil;

}

/*
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
[self handleCheckTrackerDelete:buttonIndex];
}

*/

#pragma mark -
#pragma mark Table view methods
Expand Down Expand Up @@ -394,34 +394,24 @@ - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEd
msg = [NSString stringWithFormat:@"Tracker %@ has %d records.",tname,entries];
}

if (SYSTEM_VERSION_LESS_THAN(@"8.0")) {
UIAlertView* alert = [[UIAlertView alloc]
initWithTitle:title
message:msg
delegate:self
cancelButtonTitle:btn0
otherButtonTitles: btn1,btn2,nil];

[alert show];
} else {
UIAlertController* alert = [UIAlertController alertControllerWithTitle:title
message:msg
preferredStyle:UIAlertControllerStyleAlert];

UIAlertAction* cancelAction = [UIAlertAction actionWithTitle:btn0 style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { [self handleCheckTrackerDelete:0]; }];
UIAlertAction* deleteAction = [UIAlertAction actionWithTitle:btn1 style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { [self handleCheckTrackerDelete:1]; }];
[alert addAction:cancelAction];
[alert addAction:deleteAction];

if (btn2) {
UIAlertAction* deleteRecordsAction = [UIAlertAction actionWithTitle:btn2 style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { [self handleCheckTrackerDelete:2]; }];
[alert addAction:deleteRecordsAction];
}


[self presentViewController:alert animated:YES completion:nil];

UIAlertController* alert = [UIAlertController alertControllerWithTitle:title
message:msg
preferredStyle:UIAlertControllerStyleAlert];

UIAlertAction* cancelAction = [UIAlertAction actionWithTitle:btn0 style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { [self handleCheckTrackerDelete:0]; }];
UIAlertAction* deleteAction = [UIAlertAction actionWithTitle:btn1 style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { [self handleCheckTrackerDelete:1]; }];
[alert addAction:cancelAction];
[alert addAction:deleteAction];

if (btn2) {
UIAlertAction* deleteRecordsAction = [UIAlertAction actionWithTitle:btn2 style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { [self handleCheckTrackerDelete:2]; }];
[alert addAction:deleteRecordsAction];
}


[self presentViewController:alert animated:YES completion:nil];


}

// Override to support row selection in the table view.
Expand Down
2 changes: 1 addition & 1 deletion Classes/datePickerVC.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
/***************
datePickerVC.h
Copyright 2010-2016 Robert T. Miller
Copyright 2010-2021 Robert T. Miller
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Classes/datePickerVC.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************
datePickerVC.m
Copyright 2010-2016 Robert T. Miller
Copyright 2010-2021 Robert T. Miller
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
3 changes: 2 additions & 1 deletion Classes/dbg-defs.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************
dbg-defs.h
Copyright 2011-2016 Robert T. Miller
Copyright 2011-2021 Robert T. Miller
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -34,6 +34,7 @@
#define SQLDEBUG 0
#define FUNCTIONDBG 0
#define REMINDERDBG 0
#define GRAPHDBG 0


// enable advertising code -- controlled in Xcode build settings (Apple LLVM -> Preprocessing -> Preprocessor macros) for rTrackerA
Expand Down
2 changes: 1 addition & 1 deletion Classes/dpRslt.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************
dpRslt.h
Copyright 2011-2016 Robert T. Miller
Copyright 2011-2021 Robert T. Miller
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Classes/dpRslt.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************
dpRslt.m
Copyright 2011-2016 Robert T. Miller
Copyright 2011-2021 Robert T. Miller
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Classes/gfx.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************
gfx.h
Copyright 2011-2016 Robert T. Miller
Copyright 2011-2021 Robert T. Miller
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Classes/graphTracker-constants.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************
graphTracker-constants.h
Copyright 2011-2016 Robert T. Miller
Copyright 2011-2021 Robert T. Miller
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Classes/graphTrackerV.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************
graphTrackerV.h
Copyright 2010-2016 Robert T. Miller
Copyright 2010-2021 Robert T. Miller
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit 956f5a3

Please sign in to comment.