CCManageHelp.m 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. //
  2. // CCManageHelp.m
  3. // Crypto Cloud Technology Nextcloud
  4. //
  5. // Created by Marino Faggiana on 06/11/15.
  6. // Copyright (c) 2014 TWS. All rights reserved.
  7. //
  8. // Author Marino Faggiana <m.faggiana@twsweb.it>
  9. //
  10. // This program is free software: you can redistribute it and/or modify
  11. // it under the terms of the GNU General Public License as published by
  12. // the Free Software Foundation, either version 3 of the License, or
  13. // (at your option) any later version.
  14. //
  15. // This program is distributed in the hope that it will be useful,
  16. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. // GNU General Public License for more details.
  19. //
  20. // You should have received a copy of the GNU General Public License
  21. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. //
  23. #import "CCManageHelp.h"
  24. #import "CCUtility.h"
  25. #import "AppDelegate.h"
  26. @interface CCManageHelp ()
  27. @end
  28. @implementation CCManageHelp
  29. - (id)initWithCoder:(NSCoder *)aDecoder
  30. {
  31. self = [super initWithCoder:aDecoder];
  32. if (self) {
  33. [self initializeForm];
  34. }
  35. return self;
  36. }
  37. - (void)initializeForm
  38. {
  39. XLFormDescriptor *form ;
  40. XLFormSectionDescriptor *section;
  41. XLFormRowDescriptor *row;
  42. form = [XLFormDescriptor formDescriptorWithTitle:NSLocalizedString(@"_help_", nil)];
  43. section = [XLFormSectionDescriptor formSectionWithTitle:NSLocalizedString(@"_help_tutorial_", nil)];
  44. [form addFormSection:section];
  45. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"intro" rowType:XLFormRowDescriptorTypeButton title:[CCUtility localizableBrand:@"_help_intro_" table:nil]];
  46. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
  47. [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
  48. [row.cellConfig setObject:COLOR_BRAND forKey:@"textLabel.textColor"];
  49. row.action.formSelector = @selector(intro:);
  50. [section addFormRow:row];
  51. section = [XLFormSectionDescriptor formSectionWithTitle:NSLocalizedString(@"_help_debug_section_", nil)];
  52. [form addFormSection:section];
  53. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"activityVerboseDebug" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_help_debug_Activity_verbose_", nil)];
  54. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
  55. if ([CCUtility getActivityVerboseDebug]) row.value = @"1";
  56. else row.value = @"0";
  57. [section addFormRow:row];
  58. section = [XLFormSectionDescriptor formSection];
  59. [form addFormSection:section];
  60. self.form = form;
  61. }
  62. - (void)viewDidLoad
  63. {
  64. [super viewDidLoad];
  65. // Color
  66. [CCAspect aspectNavigationControllerBar:self.navigationController.navigationBar encrypted:NO online:[app.reachability isReachable] hidden:NO];
  67. [CCAspect aspectTabBar:self.tabBarController.tabBar hidden:NO];
  68. // Intro
  69. self.intro = [[CCIntro alloc] initWithDelegate:self delegateView:self.splitViewController.view];
  70. }
  71. // Apparirà
  72. - (void)viewWillAppear:(BOOL)animated
  73. {
  74. [super viewWillAppear:animated];
  75. // Color
  76. [CCAspect aspectNavigationControllerBar:self.navigationController.navigationBar encrypted:NO online:[app.reachability isReachable] hidden:NO];
  77. [CCAspect aspectTabBar:self.tabBarController.tabBar hidden:NO];
  78. }
  79. - (void)formRowDescriptorValueHasChanged:(XLFormRowDescriptor *)rowDescriptor oldValue:(id)oldValue newValue:(id)newValue
  80. {
  81. [super formRowDescriptorValueHasChanged:rowDescriptor oldValue:oldValue newValue:newValue];
  82. if ([rowDescriptor.tag isEqualToString:@"activityVerboseDebug"]) {
  83. if ([[rowDescriptor.value valueData] boolValue] == YES) {
  84. [CCUtility setActivityVerboseDebug:true];
  85. } else {
  86. [CCUtility setActivityVerboseDebug:false];
  87. }
  88. }
  89. }
  90. - (void)intro:(XLFormRowDescriptor *)sender
  91. {
  92. [self deselectFormRow:sender];
  93. [self.intro showIntroCryptoCloud:0.1];
  94. }
  95. @end