Privacy: Settings: Add "IDENTITY SERVER" section

This commit is contained in:
manuroe
2019-09-17 14:33:28 +02:00
parent cd6919e5c4
commit 78246d0366
3 changed files with 83 additions and 2 deletions
+62 -2
View File
@@ -54,9 +54,10 @@ enum
SETTINGS_SECTION_NOTIFICATIONS_SETTINGS_INDEX,
SETTINGS_SECTION_CALLS_INDEX,
SETTINGS_SECTION_DISCOVERY_INDEX,
SETTINGS_SECTION_USER_INTERFACE_INDEX,
SETTINGS_SECTION_IGNORED_USERS_INDEX,
SETTINGS_SECTION_IDENTITY_SERVER_INDEX,
SETTINGS_SECTION_CONTACTS_INDEX,
SETTINGS_SECTION_IGNORED_USERS_INDEX,
SETTINGS_SECTION_USER_INTERFACE_INDEX,
SETTINGS_SECTION_ADVANCED_INDEX,
SETTINGS_SECTION_OTHER_INDEX,
SETTINGS_SECTION_LABS_INDEX,
@@ -100,6 +101,13 @@ enum
USER_INTERFACE_COUNT
};
enum
{
IDENTITY_SERVER_INDEX,
IDENTITY_SERVER_DESCRIPTION_INDEX,
IDENTITY_SERVER_COUNT
};
enum
{
OTHER_VERSION_INDEX = 0,
@@ -1304,6 +1312,10 @@ SettingsDiscoveryTableViewSectionDelegate, SettingsDiscoveryViewModelCoordinator
{
count = self.settingsDiscoveryTableViewSection.numberOfRows;
}
else if (section == SETTINGS_SECTION_IDENTITY_SERVER_INDEX)
{
count = IDENTITY_SERVER_COUNT;
}
else if (section == SETTINGS_SECTION_USER_INTERFACE_INDEX)
{
count = USER_INTERFACE_COUNT;
@@ -1927,6 +1939,50 @@ SettingsDiscoveryTableViewSectionDelegate, SettingsDiscoveryViewModelCoordinator
{
cell = [self.settingsDiscoveryTableViewSection cellForRowAtRow:row];
}
else if (section == SETTINGS_SECTION_IDENTITY_SERVER_INDEX)
{
switch (row)
{
case IDENTITY_SERVER_INDEX:
{
MXKTableViewCell *isCell = [self getDefaultTableViewCell:tableView];
if (account.mxSession.identityService.identityServer)
{
isCell.textLabel.text = account.mxSession.identityService.identityServer;
}
else
{
isCell.textLabel.text = NSLocalizedStringFromTable(@"settings_identity_server_no_is", @"Vector", nil);
}
isCell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell = isCell;
break;
}
case IDENTITY_SERVER_DESCRIPTION_INDEX:
{
MXKTableViewCell *descriptionCell = [self getDefaultTableViewCell:tableView];
if (account.mxSession.identityService.identityServer)
{
descriptionCell.textLabel.text = NSLocalizedStringFromTable(@"settings_identity_server_description", @"Vector", nil);
}
else
{
descriptionCell.textLabel.text = NSLocalizedStringFromTable(@"settings_identity_server_no_is_description", @"Vector", nil);
}
descriptionCell.textLabel.numberOfLines = 0;
descriptionCell.selectionStyle = UITableViewCellSelectionStyleNone;
cell = descriptionCell;
break;
}
default:
break;
}
}
else if (section == SETTINGS_SECTION_USER_INTERFACE_INDEX)
{
if (row == USER_INTERFACE_LANGUAGE_INDEX)
@@ -2430,6 +2486,10 @@ SettingsDiscoveryTableViewSectionDelegate, SettingsDiscoveryViewModelCoordinator
{
return NSLocalizedStringFromTable(@"settings_discovery_settings", @"Vector", nil);
}
else if (section == SETTINGS_SECTION_IDENTITY_SERVER_INDEX)
{
return NSLocalizedStringFromTable(@"settings_identity_server_settings", @"Vector", nil);
}
else if (section == SETTINGS_SECTION_USER_INTERFACE_INDEX)
{
return NSLocalizedStringFromTable(@"settings_user_interface", @"Vector", nil);