Skip to content

Commit

Permalink
Add proxy to classic email-login (#2390)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitschlag committed Nov 18, 2024
1 parent 2f9ee75 commit 3778417
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions deltachat-ios/Controller/AccountSetup/AccountSetupController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class AccountSetupController: UITableViewController {
private let tagSmtpSecurityCell = 11
private let tagCertCheckCell = 12
private let tagViewLogCell = 15
private let tagProxyCell = 16

private let tagTextFieldEmail = 100
private let tagTextFieldPassword = 200
Expand Down Expand Up @@ -53,6 +54,7 @@ class AccountSetupController: UITableViewController {
smtpServerCell,
smtpPortCell,
certCheckCell,
proxyCell,
viewLogCell
]
private let editView: Bool
Expand Down Expand Up @@ -239,6 +241,14 @@ class AccountSetupController: UITableViewController {

lazy var certValue: Int = dcContext.certificateChecks

lazy var proxyCell: UITableViewCell = {
let cell = UITableViewCell(style: .value1, reuseIdentifier: nil)
cell.textLabel?.text = String.localized("proxy_settings")
cell.tag = tagProxyCell
cell.accessoryType = .disclosureIndicator
return cell
}()

lazy var viewLogCell: UITableViewCell = {
let cell = UITableViewCell(style: .value1, reuseIdentifier: nil)
cell.textLabel?.text = String.localized("pref_view_log")
Expand Down Expand Up @@ -296,6 +306,11 @@ class AccountSetupController: UITableViewController {
super.viewWillAppear(animated)
initSelectionCells()
handleLoginButton()
updateCells()
}

private func updateCells() {
proxyCell.detailTextLabel?.text = dcContext.isProxyEnabled ? String.localized("on") : nil
}

override func viewWillDisappear(_ animated: Bool) {
Expand Down Expand Up @@ -365,6 +380,8 @@ class AccountSetupController: UITableViewController {
case tagViewLogCell:
tableView.deselectRow(at: indexPath, animated: false)
showLogViewController()
case tagProxyCell:
showProxySettings()
default:
break
}
Expand Down Expand Up @@ -587,6 +604,11 @@ class AccountSetupController: UITableViewController {

// MARK: - coordinator

private func showProxySettings() {
let proxySettingsController = ProxySettingsViewController(dcContext: dcContext, dcAccounts: dcAccounts)
navigationController?.pushViewController(proxySettingsController, animated: true)
}

private func showLogViewController() {
let controller = LogViewController(dcContext: dcContext)
navigationController?.pushViewController(controller, animated: true)
Expand Down

0 comments on commit 3778417

Please sign in to comment.