added the cell, now I just need to implement the navigation to the web view

This commit is contained in:
Mauro Romito 2023-08-24 19:15:12 +02:00
parent 83e7229f6f
commit 00e19ab683
3 changed files with 56 additions and 0 deletions

View file

@ -748,6 +748,9 @@ Tap the + to start adding people.";
"settings_three_pids_management_information_part1" = "Manage which email addresses or phone numbers you can use to log in or recover your account here. Control who can find you in ";
"settings_three_pids_management_information_part2" = "Discovery";
"settings_three_pids_management_information_part3" = ".";
"settings_manage_account_title" = "Account";
"settings_manage_account_action" = "Manage";
"settings_manage_account_description" = "Manage your account at %@";
"settings_confirm_media_size" = "Confirm size when sending";
"settings_confirm_media_size_description" = "When this is on, youll be asked to confirm what size images and videos will be sent as.";

View file

@ -7791,6 +7791,18 @@ public class VectorL10n: NSObject {
public static var settingsLinks: String {
return VectorL10n.tr("Vector", "settings_links")
}
/// Manage
public static var settingsManageAccountAction: String {
return VectorL10n.tr("Vector", "settings_manage_account_action")
}
/// Manage your account at %@
public static func settingsManageAccountDescription(_ p1: String) -> String {
return VectorL10n.tr("Vector", "settings_manage_account_description", p1)
}
/// Account
public static var settingsManageAccountTitle: String {
return VectorL10n.tr("Vector", "settings_manage_account_title")
}
/// Mark all messages as read
public static var settingsMarkAllAsRead: String {
return VectorL10n.tr("Vector", "settings_mark_all_as_read")

View file

@ -50,6 +50,7 @@ typedef NS_ENUM(NSUInteger, SECTION_TAG)
{
SECTION_TAG_SIGN_OUT = 0,
SECTION_TAG_USER_SETTINGS,
SECTION_TAG_ACCOUNT,
SECTION_TAG_SENDING_MEDIA,
SECTION_TAG_LINKS,
SECTION_TAG_SECURITY,
@ -185,6 +186,11 @@ typedef NS_ENUM(NSUInteger, SECURITY)
DEVICE_MANAGER_INDEX
};
typedef NS_ENUM(NSUInteger, ACCOUNT)
{
ACCOUNT_MANAGE_INDEX = 0,
};
typedef void (^blockSettingsViewController_onReadyToDestroy)(void);
#pragma mark - SettingsViewController
@ -383,6 +389,16 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
sectionUserSettings.headerTitle = [VectorL10n settingsUserSettings];
[tmpSections addObject:sectionUserSettings];
NSString *manageAccountURL = self.mainSession.homeserverWellknown.authentication.account;
if (manageAccountURL)
{
Section *account = [Section sectionWithTag: SECTION_TAG_ACCOUNT];
[account addRowWithTag:ACCOUNT_MANAGE_INDEX];
account.headerTitle = [VectorL10n settingsManageAccountTitle];
account.footerTitle = [VectorL10n settingsManageAccountDescription:manageAccountURL];
[tmpSections addObject:account];
}
if (BuildSettings.settingsScreenShowConfirmMediaSize)
{
@ -2626,6 +2642,17 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
cell = deactivateAccountBtnCell;
}
else if (section == SECTION_TAG_ACCOUNT)
{
switch (row)
{
case ACCOUNT_MANAGE_INDEX:
cell = [self getDefaultTableViewCell:tableView];
cell.textLabel.text = [VectorL10n settingsManageAccountAction];
[cell vc_setAccessoryDisclosureIndicatorWithCurrentTheme];
break;
}
}
return cell;
}
@ -2975,6 +3002,14 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
break;
}
}
else if (section == SECTION_TAG_ACCOUNT)
{
switch(row) {
case ACCOUNT_MANAGE_INDEX:
[self onManageAccountTap];
break;
}
}
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
@ -3883,6 +3918,12 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
}
}
- (void)onManageAccountTap
{
// TODO
// Open a web view with the account url
}
- (void)showThemePicker
{
__weak typeof(self) weakSelf = self;