From d34c453807478f3e96c15e8c432739747ad88eb2 Mon Sep 17 00:00:00 2001 From: Chris Ballinger Date: Mon, 15 May 2017 18:10:35 -0700 Subject: [PATCH] Add More Ways to Help --- .../Classes/Controllers/OTRSettingsManager.m | 14 +- .../Classes/Model/Settings/OTRBoolSetting.m | 2 +- .../Classes/Model/Settings/OTRDonateSetting.m | 2 +- .../Classes/Model/Settings/OTRDoubleSetting.m | 2 +- .../Model/Settings/OTRFeedbackSetting.m | 2 +- .../Classes/Model/Settings/OTRIntSetting.m | 2 +- .../Classes/Model/Settings/OTRListSetting.m | 2 +- .../Classes/Model/Settings/OTRSetting.h | 2 +- .../Classes/Model/Settings/OTRShareSetting.m | 2 +- .../Classes/Model/Settings/OTRViewSetting.m | 2 +- .../OTRSettingsViewController.m | 2 +- .../View Controllers/Purchase.storyboard | 141 ++++-------------- OTRAssets/Strings/OTRStrings.h | 2 + OTRAssets/Strings/OTRStrings.m | 2 + OTRAssets/Strings/strings.json | 4 + .../Base.lproj/Localizable.strings | Bin 59992 -> 60224 bytes .../ar.lproj/Localizable.strings | Bin 58788 -> 59020 bytes .../bo.lproj/Localizable.strings | Bin 61086 -> 61318 bytes .../ca.lproj/Localizable.strings | Bin 61384 -> 61616 bytes .../cs.lproj/Localizable.strings | Bin 60080 -> 60312 bytes .../da-DK.lproj/Localizable.strings | Bin 60686 -> 60918 bytes .../de.lproj/Localizable.strings | Bin 63480 -> 63716 bytes .../el.lproj/Localizable.strings | Bin 62988 -> 63220 bytes .../es.lproj/Localizable.strings | Bin 63412 -> 63628 bytes .../fa-IR.lproj/Localizable.strings | Bin 59922 -> 60154 bytes .../fr.lproj/Localizable.strings | Bin 63556 -> 63798 bytes .../he.lproj/Localizable.strings | Bin 59722 -> 59954 bytes .../hu.lproj/Localizable.strings | Bin 61272 -> 61504 bytes .../id.lproj/Localizable.strings | Bin 60274 -> 60506 bytes .../it.lproj/Localizable.strings | Bin 62296 -> 62528 bytes .../ja.lproj/Localizable.strings | Bin 57182 -> 57414 bytes .../mr.lproj/Localizable.strings | Bin 60948 -> 61180 bytes .../nb-NO.lproj/Localizable.strings | Bin 60346 -> 60578 bytes .../nl-NL.lproj/Localizable.strings | Bin 61308 -> 61540 bytes .../nl.lproj/Localizable.strings | Bin 62324 -> 62552 bytes .../pl.lproj/Localizable.strings | Bin 61856 -> 62088 bytes .../pt-BR.lproj/Localizable.strings | Bin 61134 -> 61366 bytes .../pt-PT.lproj/Localizable.strings | Bin 61060 -> 61292 bytes .../ro-RO.lproj/Localizable.strings | Bin 61000 -> 61232 bytes .../ru.lproj/Localizable.strings | Bin 60412 -> 60644 bytes .../sk.lproj/Localizable.strings | Bin 60130 -> 60362 bytes .../sl.lproj/Localizable.strings | Bin 61076 -> 61308 bytes .../sv.lproj/Localizable.strings | Bin 60872 -> 61104 bytes .../tr.lproj/Localizable.strings | Bin 60466 -> 60698 bytes .../uk.lproj/Localizable.strings | Bin 61140 -> 61372 bytes .../uk_UA.lproj/Localizable.strings | Bin 60504 -> 60736 bytes .../uz.lproj/Localizable.strings | Bin 60062 -> 60294 bytes .../vi.lproj/Localizable.strings | Bin 60144 -> 60376 bytes .../zh-Hans-CN.lproj/Localizable.strings | Bin 52412 -> 52644 bytes .../zh-Hant-TW.lproj/Localizable.strings | Bin 54966 -> 55198 bytes Submodules/ChatSecure-Metadata | 2 +- 51 files changed, 58 insertions(+), 127 deletions(-) diff --git a/ChatSecure/Classes/Controllers/OTRSettingsManager.m b/ChatSecure/Classes/Controllers/OTRSettingsManager.m index 56f1ab0cd..143a0a516 100644 --- a/ChatSecure/Classes/Controllers/OTRSettingsManager.m +++ b/ChatSecure/Classes/Controllers/OTRSettingsManager.m @@ -71,8 +71,18 @@ - (void) populateSettings donateTitle = [NSString stringWithFormat:@"%@ 🆕", DONATE_STRING()]; } OTRDonateSetting *donateSetting = [[OTRDonateSetting alloc] initWithTitle:donateTitle description:nil]; - donateSetting.imageName = @"29-heart.png"; - OTRSettingsGroup *donateGroup = [[OTRSettingsGroup alloc] initWithTitle:DONATE_STRING() settings:@[donateSetting]]; + //donateSetting.imageName = @"29-heart.png"; + OTRSetting *moreSetting = [[OTRSetting alloc] initWithTitle:MORE_WAYS_TO_HELP_STRING() description:nil]; + moreSetting.actionBlock = ^void(id sender) { + UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Purchase" bundle:[OTRAssets resourcesBundle]]; + UIViewController *moreVC = [storyboard instantiateViewControllerWithIdentifier:@"moreWaysToHelp"]; + UIViewController *sourceVC = sender; + if (![sender isKindOfClass:[UIViewController class]]) { + return; + } + [sourceVC presentViewController:moreVC animated:YES completion:nil]; + }; + OTRSettingsGroup *donateGroup = [[OTRSettingsGroup alloc] initWithTitle:DONATE_STRING() settings:@[donateSetting, moreSetting]]; [settingsGroups addObject:donateGroup]; } diff --git a/ChatSecure/Classes/Model/Settings/OTRBoolSetting.m b/ChatSecure/Classes/Model/Settings/OTRBoolSetting.m index 7aed6f826..154f0ea3a 100644 --- a/ChatSecure/Classes/Model/Settings/OTRBoolSetting.m +++ b/ChatSecure/Classes/Model/Settings/OTRBoolSetting.m @@ -29,7 +29,7 @@ - (id) initWithTitle:(NSString *)newTitle description:(NSString *)newDescription if (self = [super initWithTitle:newTitle description:newDescription settingsKey:newSettingsKey]) { __weak typeof (self) weakSelf = self; - self.actionBlock = ^{ + self.actionBlock = ^void(id sender) { [weakSelf toggle]; }; self.defaultValue = [NSNumber numberWithBool:NO]; diff --git a/ChatSecure/Classes/Model/Settings/OTRDonateSetting.m b/ChatSecure/Classes/Model/Settings/OTRDonateSetting.m index 58c7fef16..06d787419 100644 --- a/ChatSecure/Classes/Model/Settings/OTRDonateSetting.m +++ b/ChatSecure/Classes/Model/Settings/OTRDonateSetting.m @@ -17,7 +17,7 @@ -(id)initWithTitle:(NSString *)newTitle description:(NSString *)newDescription self = [super initWithTitle:newTitle description:newDescription]; if (self) { __weak typeof (self) weakSelf = self; - self.actionBlock = ^{ + self.actionBlock = ^void(id sender){ [weakSelf openDonationDialog]; }; } diff --git a/ChatSecure/Classes/Model/Settings/OTRDoubleSetting.m b/ChatSecure/Classes/Model/Settings/OTRDoubleSetting.m index 0f54d873d..5100b60a4 100644 --- a/ChatSecure/Classes/Model/Settings/OTRDoubleSetting.m +++ b/ChatSecure/Classes/Model/Settings/OTRDoubleSetting.m @@ -33,7 +33,7 @@ - (id) initWithTitle:(NSString *)newTitle description:(NSString *)newDescription if (self = [super initWithTitle:newTitle description:newDescription settingsKey:newSettingsKey]) { __weak typeof (self) weakSelf = self; - self.actionBlock = ^{ + self.actionBlock = ^void(id sender){ [weakSelf editValue]; }; self.defaultValue = [NSNumber numberWithDouble:0.0]; diff --git a/ChatSecure/Classes/Model/Settings/OTRFeedbackSetting.m b/ChatSecure/Classes/Model/Settings/OTRFeedbackSetting.m index db6dd2ffa..72ba86b91 100644 --- a/ChatSecure/Classes/Model/Settings/OTRFeedbackSetting.m +++ b/ChatSecure/Classes/Model/Settings/OTRFeedbackSetting.m @@ -16,7 +16,7 @@ - (id) initWithTitle:(NSString*)newTitle description:(NSString*)newDescription if (self = [super initWithTitle:newTitle description:newDescription]) { __weak typeof(self)weakSelf = self; - self.actionBlock = ^{ + self.actionBlock = ^void(id sender){ __strong typeof(weakSelf)strongSelf = weakSelf; [strongSelf showView]; }; diff --git a/ChatSecure/Classes/Model/Settings/OTRIntSetting.m b/ChatSecure/Classes/Model/Settings/OTRIntSetting.m index 7f563a69f..49893a246 100644 --- a/ChatSecure/Classes/Model/Settings/OTRIntSetting.m +++ b/ChatSecure/Classes/Model/Settings/OTRIntSetting.m @@ -19,7 +19,7 @@ - (id) initWithTitle:(NSString *)newTitle description:(NSString *)newDescription if (self = [super initWithTitle:newTitle description:newDescription settingsKey:newSettingsKey]) { __weak typeof (self) weakSelf = self; - self.actionBlock = ^{ + self.actionBlock = ^void(id sender){ [weakSelf editValue]; }; self.defaultValue = [NSNumber numberWithInt:0]; diff --git a/ChatSecure/Classes/Model/Settings/OTRListSetting.m b/ChatSecure/Classes/Model/Settings/OTRListSetting.m index 0f369f3d8..662051b09 100644 --- a/ChatSecure/Classes/Model/Settings/OTRListSetting.m +++ b/ChatSecure/Classes/Model/Settings/OTRListSetting.m @@ -19,7 +19,7 @@ -(id)initWithTitle:(NSString *)newTitle description:(NSString *)newDescription s if (self = [super initWithTitle:newTitle description:newDescription settingsKey:newSettingsKey]) { __weak typeof (self) weakSelf = self; - self.actionBlock = ^{ + self.actionBlock = ^void(id sender){ __strong typeof(weakSelf)strongSelf = weakSelf; [strongSelf editValue]; }; diff --git a/ChatSecure/Classes/Model/Settings/OTRSetting.h b/ChatSecure/Classes/Model/Settings/OTRSetting.h index 6d9cd828d..6ebd2fc61 100644 --- a/ChatSecure/Classes/Model/Settings/OTRSetting.h +++ b/ChatSecure/Classes/Model/Settings/OTRSetting.h @@ -30,7 +30,7 @@ - (void) otrSetting:(OTRSetting*)setting showDetailViewControllerClass:(Class)viewControllerClass; @end -typedef void (^OTRSettingActionBlock)(void); +typedef void (^OTRSettingActionBlock)(id sender); @interface OTRSetting : NSObject diff --git a/ChatSecure/Classes/Model/Settings/OTRShareSetting.m b/ChatSecure/Classes/Model/Settings/OTRShareSetting.m index e6463c36e..88408c643 100644 --- a/ChatSecure/Classes/Model/Settings/OTRShareSetting.m +++ b/ChatSecure/Classes/Model/Settings/OTRShareSetting.m @@ -23,7 +23,7 @@ -(id)initWithTitle:(NSString *)newTitle description:(NSString *)newDescription self = [super initWithTitle:newTitle description:newDescription]; if (self) { __weak typeof(self)weakSelf = self; - self.actionBlock = ^{ + self.actionBlock = ^void(id sender){ __strong typeof(weakSelf)strongSelf = weakSelf; [strongSelf showActionSheet]; }; diff --git a/ChatSecure/Classes/Model/Settings/OTRViewSetting.m b/ChatSecure/Classes/Model/Settings/OTRViewSetting.m index f7db71512..e9913d90a 100644 --- a/ChatSecure/Classes/Model/Settings/OTRViewSetting.m +++ b/ChatSecure/Classes/Model/Settings/OTRViewSetting.m @@ -32,7 +32,7 @@ - (id) initWithTitle:(NSString*)newTitle description:(NSString*)newDescription v { viewControllerClass = newViewControllerClass; __weak typeof (self) weakSelf = self; - self.actionBlock = ^{ + self.actionBlock = ^void(id sender){ [weakSelf showView]; }; self.accessoryType = UITableViewCellAccessoryNone; diff --git a/ChatSecure/Classes/View Controllers/OTRSettingsViewController.m b/ChatSecure/Classes/View Controllers/OTRSettingsViewController.m index 214fa27d9..399e4a8ef 100644 --- a/ChatSecure/Classes/View Controllers/OTRSettingsViewController.m +++ b/ChatSecure/Classes/View Controllers/OTRSettingsViewController.m @@ -257,7 +257,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath OTRSetting *setting = [self.settingsManager settingAtIndexPath:indexPath]; OTRSettingActionBlock actionBlock = setting.actionBlock; if (actionBlock) { - actionBlock(); + actionBlock(self); } } [tableView deselectRowAtIndexPath:indexPath animated:YES]; diff --git a/ChatSecure/Classes/View Controllers/Purchase.storyboard b/ChatSecure/Classes/View Controllers/Purchase.storyboard index b08d7fe7f..5300ff253 100644 --- a/ChatSecure/Classes/View Controllers/Purchase.storyboard +++ b/ChatSecure/Classes/View Controllers/Purchase.storyboard @@ -1,6 +1,6 @@ - - + + @@ -19,17 +19,17 @@ - + - + - +