diff --git a/deltachat-ios/Controller/Settings/AdvancedViewController.swift b/deltachat-ios/Controller/Settings/AdvancedViewController.swift index 8cc07eeb4..03f2fbf4b 100644 --- a/deltachat-ios/Controller/Settings/AdvancedViewController.swift +++ b/deltachat-ios/Controller/Settings/AdvancedViewController.swift @@ -17,6 +17,7 @@ internal final class AdvancedViewController: UITableViewController, ProgressAler case manageKeys case videoChat case viewLog + case accountSettings } private var dcContext: DcContext @@ -59,6 +60,14 @@ internal final class AdvancedViewController: UITableViewController, ProgressAler return cell }() + private lazy var accountSettingsCell: UITableViewCell = { + let cell = UITableViewCell(style: .default, reuseIdentifier: nil) + cell.textLabel?.text = String.localized("pref_password_and_account_settings") + cell.accessoryType = .disclosureIndicator + cell.tag = CellTags.accountSettings.rawValue + return cell + }() + lazy var sentboxWatchCell: SwitchCell = { return SwitchCell( textLabel: String.localized("pref_watch_sent_folder"), @@ -212,7 +221,7 @@ internal final class AdvancedViewController: UITableViewController, ProgressAler let serverSection = SectionConfigs( headerTitle: String.localized("pref_imap_folder_handling"), footerTitle: String.localized("pref_only_fetch_mvbox_explain"), - cells: [sentboxWatchCell, sendCopyToSelfCell, mvboxMoveCell, onlyFetchMvboxCell]) + cells: [accountSettingsCell, sentboxWatchCell, sendCopyToSelfCell, mvboxMoveCell, onlyFetchMvboxCell]) return [viewLogSection, experimentalSection, appAccessSection, autocryptSection, serverSection] }() @@ -280,6 +289,7 @@ internal final class AdvancedViewController: UITableViewController, ProgressAler case .manageKeys: showManageKeysDialog() case .videoChat: showVideoChatInstance() case .viewLog: showLogViewController() + case .accountSettings: showAccountSettingsController() } } @@ -333,6 +343,11 @@ internal final class AdvancedViewController: UITableViewController, ProgressAler navigationController?.pushViewController(controller, animated: true) } + private func showAccountSettingsController() { + let controller = AccountSetupController(dcAccounts: dcAccounts, editView: true) + navigationController?.pushViewController(controller, animated: true) + } + private func showManageKeysDialog() { let alert = UIAlertController(title: String.localized("pref_manage_keys"), message: nil, preferredStyle: .safeActionSheet) diff --git a/deltachat-ios/Controller/Settings/SelfProfileViewController.swift b/deltachat-ios/Controller/Settings/SelfProfileViewController.swift index 8bb2e6818..7cd1e50df 100644 --- a/deltachat-ios/Controller/Settings/SelfProfileViewController.swift +++ b/deltachat-ios/Controller/Settings/SelfProfileViewController.swift @@ -11,13 +11,7 @@ class SelfProfileViewController: UITableViewController, MediaPickerDelegate { private let section1Status = 2 private let section1RowCount = 3 - private let section2 = 1 - private let section2AccountSettings = 0 - private let section2RowCount = 1 - - private let sectionCount = 2 - - private let tagAccountSettingsCell = 1 + private let sectionCount = 1 private lazy var mediaPicker: MediaPicker? = { let mediaPicker = MediaPicker(dcContext: dcContext, navigationController: navigationController) @@ -32,14 +26,6 @@ class SelfProfileViewController: UITableViewController, MediaPickerDelegate { return cell }() - private lazy var accountSettingsCell: UITableViewCell = { - let cell = UITableViewCell(style: .default, reuseIdentifier: nil) - cell.textLabel?.text = String.localized("pref_password_and_account_settings") - cell.accessoryType = .disclosureIndicator - cell.tag = tagAccountSettingsCell - return cell - }() - private lazy var avatarSelectionCell: AvatarSelectionCell = { return AvatarSelectionCell(image: dcContext.getSelfAvatarImage()) }() @@ -85,9 +71,8 @@ class SelfProfileViewController: UITableViewController, MediaPickerDelegate { override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { if section == section1 { return section1RowCount - } else { - return section2RowCount } + return 0 } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { @@ -100,11 +85,10 @@ class SelfProfileViewController: UITableViewController, MediaPickerDelegate { case section1Status: return statusCell default: - return UITableViewCell() + break } - } else { - return accountSettingsCell } + return UITableViewCell() } override func tableView(_: UITableView, titleForFooterInSection section: Int) -> String? { @@ -115,16 +99,6 @@ class SelfProfileViewController: UITableViewController, MediaPickerDelegate { } } - override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - guard let cell = tableView.cellForRow(at: indexPath) else { return } - if cell.tag == tagAccountSettingsCell { - tableView.deselectRow(at: indexPath, animated: false) - guard let nc = navigationController else { return } - let accountSetupVC = AccountSetupController(dcAccounts: dcAccounts, editView: true) - nc.pushViewController(accountSetupVC, animated: true) - } - } - // MARK: - actions private func galleryButtonPressed(_ action: UIAlertAction) { mediaPicker?.showPhotoGallery()