Make the application settings more configurable

This commit is contained in:
Gil Eluard
2021-03-31 19:04:00 +02:00
parent dc29083101
commit 9153ebbff2
5 changed files with 101 additions and 42 deletions

View File

@@ -329,41 +329,53 @@ TableViewSectionsDelegate>
// Crypto sessions section
Section *sessionsSection = [Section sectionWithTag:SECTION_CRYPTO_SESSIONS];
sessionsSection.headerTitle = NSLocalizedStringFromTable(@"security_settings_crypto_sessions", @"Vector", nil);
NSUInteger sessionsSectionRowsCount;
if (self.showLoadingDevicesInformation)
if (!RiotSettings.shared.accountManagedExternally)
{
sessionsSectionRowsCount = 2;
} else {
sessionsSectionRowsCount = devicesArray.count + 1;
}
Section *sessionsSection = [Section sectionWithTag:SECTION_CRYPTO_SESSIONS];
sessionsSection.headerTitle = NSLocalizedStringFromTable(@"security_settings_crypto_sessions", @"Vector", nil);
NSUInteger sessionsSectionRowsCount;
if (self.showLoadingDevicesInformation)
{
sessionsSectionRowsCount = 2;
}
else
{
sessionsSectionRowsCount = devicesArray.count + 1;
}
[sessionsSection addRowsWithCount:sessionsSectionRowsCount];
[sections addObject:sessionsSection];
[sessionsSection addRowsWithCount:sessionsSectionRowsCount];
[sections addObject:sessionsSection];
}
// Secure backup
Section *secureBackupSection = [Section sectionWithTag:SECTION_SECURE_BACKUP];
secureBackupSection.headerTitle = NSLocalizedStringFromTable(@"security_settings_secure_backup", @"Vector", nil);
[secureBackupSection addRowsWithCount:[self numberOfRowsInSecureBackupSection]];
[sections addObject:secureBackupSection];
if (!RiotSettings.shared.accountManagedExternally)
{
Section *secureBackupSection = [Section sectionWithTag:SECTION_SECURE_BACKUP];
secureBackupSection.headerTitle = NSLocalizedStringFromTable(@"security_settings_secure_backup", @"Vector", nil);
[secureBackupSection addRowsWithCount:[self numberOfRowsInSecureBackupSection]];
[sections addObject:secureBackupSection];
}
// Cryptograhpy
Section *cryptograhpySection = [Section sectionWithTag:SECTION_CRYPTOGRAPHY];
cryptograhpySection.headerTitle = NSLocalizedStringFromTable(@"security_settings_cryptography", @"Vector", nil);
[cryptograhpySection addRowsWithCount:CRYPTOGRAPHY_COUNT];
[sections addObject:cryptograhpySection];
if (!RiotSettings.shared.accountManagedExternally)
{
Section *cryptograhpySection = [Section sectionWithTag:SECTION_CRYPTOGRAPHY];
cryptograhpySection.headerTitle = NSLocalizedStringFromTable(@"security_settings_cryptography", @"Vector", nil);
[cryptograhpySection addRowWithTag:CRYPTOGRAPHY_INFO];
[cryptograhpySection addRowWithTag:CRYPTOGRAPHY_EXPORT];
[sections addObject:cryptograhpySection];
}
#ifdef CROSS_SIGNING_AND_BACKUP_DEV
@@ -389,13 +401,16 @@ TableViewSectionsDelegate>
// Advanced
Section *advancedSection = [Section sectionWithTag:SECTION_ADVANCED];
advancedSection.headerTitle = NSLocalizedStringFromTable(@"security_settings_advanced", @"Vector", nil);
[advancedSection addRowWithTag:ADVANCED_BLACKLIST_UNVERIFIED_DEVICES];
[advancedSection addRowWithTag:ADVANCED_BLACKLIST_UNVERIFIED_DEVICES_DESCRIPTION];
[sections addObject:advancedSection];
if (!RiotSettings.shared.accountManagedExternally)
{
Section *advancedSection = [Section sectionWithTag:SECTION_ADVANCED];
advancedSection.headerTitle = NSLocalizedStringFromTable(@"security_settings_advanced", @"Vector", nil);
[advancedSection addRowWithTag:ADVANCED_BLACKLIST_UNVERIFIED_DEVICES];
[advancedSection addRowWithTag:ADVANCED_BLACKLIST_UNVERIFIED_DEVICES_DESCRIPTION];
[sections addObject:advancedSection];
}
// Update sections