CCManageHelp.m 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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. @interface CCManageHelp ()
  26. @end
  27. @implementation CCManageHelp
  28. - (id)initWithCoder:(NSCoder *)aDecoder
  29. {
  30. self = [super initWithCoder:aDecoder];
  31. if (self) {
  32. [self initializeForm];
  33. }
  34. return self;
  35. }
  36. - (void)initializeForm
  37. {
  38. XLFormDescriptor *form ;
  39. XLFormSectionDescriptor *section;
  40. XLFormRowDescriptor *row;
  41. form = [XLFormDescriptor formDescriptorWithTitle:NSLocalizedString(@"_help_", nil)];
  42. section = [XLFormSectionDescriptor formSectionWithTitle:NSLocalizedString(@"_help_tutorial_", nil)];
  43. [form addFormSection:section];
  44. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"intro" rowType:XLFormRowDescriptorTypeButton title:[CCUtility localizableBrand:@"_help_intro_" table:nil]];
  45. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
  46. [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
  47. row.action.formSelector = @selector(intro:);
  48. [section addFormRow:row];
  49. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"switchuser" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_help_switch_user_", nil)];
  50. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
  51. [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
  52. row.action.formSelector = @selector(switchUser:);
  53. [section addFormRow:row];
  54. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"controlcenter" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_help_control_center_", nil)];
  55. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
  56. [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
  57. row.action.formSelector = @selector(controlCenter:);
  58. [section addFormRow:row];
  59. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"copypaste" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_help_copy_paste_", nil)];
  60. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
  61. [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
  62. row.action.formSelector = @selector(copypaste:);
  63. [section addFormRow:row];
  64. section = [XLFormSectionDescriptor formSection];
  65. [form addFormSection:section];
  66. self.form = form;
  67. }
  68. - (void)viewDidLoad
  69. {
  70. [super viewDidLoad];
  71. // Color
  72. [CCAspect aspectNavigationControllerBar:self.navigationController.navigationBar hidden:NO];
  73. [CCAspect aspectTabBar:self.tabBarController.tabBar hidden:NO];
  74. // Intro
  75. self.intro = [[CCIntro alloc] initWithDelegate:self delegateView:self.splitViewController.view];
  76. }
  77. // Apparirà
  78. - (void)viewWillAppear:(BOOL)animated
  79. {
  80. [super viewWillAppear:animated];
  81. // Color
  82. [CCAspect aspectNavigationControllerBar:self.navigationController.navigationBar hidden:NO];
  83. [CCAspect aspectTabBar:self.tabBarController.tabBar hidden:NO];
  84. }
  85. - (void)intro:(XLFormRowDescriptor *)sender
  86. {
  87. [self deselectFormRow:sender];
  88. [self.intro showIntroCryptoCloud:0.1];
  89. }
  90. - (void)share:(XLFormRowDescriptor *)sender
  91. {
  92. [self deselectFormRow:sender];
  93. [self.intro showIntroVersion:@"1.91" duration:0.1 review:YES];
  94. }
  95. - (void)itunesshare:(XLFormRowDescriptor *)sender
  96. {
  97. [self deselectFormRow:sender];
  98. [self.intro showIntroVersion:@"1.94" duration:0.1 review:YES];
  99. }
  100. - (void)shareExt:(XLFormRowDescriptor *)sender
  101. {
  102. [self deselectFormRow:sender];
  103. [self.intro showIntroVersion:@"1.96" duration:0.1 review:YES];
  104. }
  105. - (void)switchUser:(XLFormRowDescriptor *)sender
  106. {
  107. [self deselectFormRow:sender];
  108. [self.intro showIntroVersion:@"1.99" duration:0.1 review:YES];
  109. }
  110. - (void)controlCenter:(XLFormRowDescriptor *)sender
  111. {
  112. [self deselectFormRow:sender];
  113. [self.intro showIntroVersion:@"2.0" duration:0.1 review:YES];
  114. }
  115. - (void)copypaste:(XLFormRowDescriptor *)sender
  116. {
  117. [self deselectFormRow:sender];
  118. [self.intro showIntroVersion:@"2.10" duration:0.1 review:YES];
  119. }
  120. @end