CCManageHelp.m 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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. #ifdef CC
  50. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"synchronizations" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_help_synchronizations_", nil)];
  51. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
  52. [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
  53. row.action.formSelector = @selector(synchronizations:);
  54. [section addFormRow:row];
  55. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"share" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_help_share_", nil)];
  56. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
  57. [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
  58. row.action.formSelector = @selector(share:);
  59. [section addFormRow:row];
  60. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"itunesshare" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_help_itunes_share_", nil)];
  61. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
  62. [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
  63. row.action.formSelector = @selector(itunesshare:);
  64. [section addFormRow:row];
  65. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"shareext" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_help_share_ext_", nil)];
  66. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
  67. [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
  68. row.action.formSelector = @selector(shareExt:);
  69. [section addFormRow:row];
  70. #endif
  71. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"switchuser" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_help_switch_user_", nil)];
  72. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
  73. [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
  74. row.action.formSelector = @selector(switchUser:);
  75. [section addFormRow:row];
  76. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"controlcenter" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_help_control_center_", nil)];
  77. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
  78. [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
  79. row.action.formSelector = @selector(controlCenter:);
  80. [section addFormRow:row];
  81. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"copypaste" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_help_copy_paste_", nil)];
  82. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
  83. [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
  84. row.action.formSelector = @selector(copypaste:);
  85. [section addFormRow:row];
  86. section = [XLFormSectionDescriptor formSection];
  87. [form addFormSection:section];
  88. self.form = form;
  89. }
  90. - (void)viewDidLoad
  91. {
  92. [super viewDidLoad];
  93. // Color
  94. [CCAspect aspectNavigationControllerBar:self.navigationController.navigationBar hidden:NO];
  95. [CCAspect aspectTabBar:self.tabBarController.tabBar hidden:NO];
  96. // Intro
  97. self.intro = [[CCIntro alloc] initWithDelegate:self delegateView:self.splitViewController.view];
  98. }
  99. // Apparirà
  100. - (void)viewWillAppear:(BOOL)animated
  101. {
  102. [super viewWillAppear:animated];
  103. // Color
  104. [CCAspect aspectNavigationControllerBar:self.navigationController.navigationBar hidden:NO];
  105. [CCAspect aspectTabBar:self.tabBarController.tabBar hidden:NO];
  106. }
  107. - (void)intro:(XLFormRowDescriptor *)sender
  108. {
  109. [self deselectFormRow:sender];
  110. [self.intro showIntroCryptoCloud:0.1];
  111. }
  112. - (void)synchronizations:(XLFormRowDescriptor *)sender
  113. {
  114. [self deselectFormRow:sender];
  115. [self.intro showIntroVersion:@"1.90" duration:0.1 review:YES];
  116. }
  117. - (void)share:(XLFormRowDescriptor *)sender
  118. {
  119. [self deselectFormRow:sender];
  120. [self.intro showIntroVersion:@"1.91" duration:0.1 review:YES];
  121. }
  122. - (void)itunesshare:(XLFormRowDescriptor *)sender
  123. {
  124. [self deselectFormRow:sender];
  125. [self.intro showIntroVersion:@"1.94" duration:0.1 review:YES];
  126. }
  127. - (void)shareExt:(XLFormRowDescriptor *)sender
  128. {
  129. [self deselectFormRow:sender];
  130. [self.intro showIntroVersion:@"1.96" duration:0.1 review:YES];
  131. }
  132. - (void)switchUser:(XLFormRowDescriptor *)sender
  133. {
  134. [self deselectFormRow:sender];
  135. [self.intro showIntroVersion:@"1.99" duration:0.1 review:YES];
  136. }
  137. - (void)controlCenter:(XLFormRowDescriptor *)sender
  138. {
  139. [self deselectFormRow:sender];
  140. [self.intro showIntroVersion:@"2.0" duration:0.1 review:YES];
  141. }
  142. - (void)copypaste:(XLFormRowDescriptor *)sender
  143. {
  144. [self deselectFormRow:sender];
  145. [self.intro showIntroVersion:@"2.10" duration:0.1 review:YES];
  146. }
  147. @end