|
@@ -37,15 +37,15 @@ internal final class SettingsViewController: UITableViewController, ProgressAler
|
|
// MARK: - cells
|
|
// MARK: - cells
|
|
|
|
|
|
private lazy var profileCell: ContactCell = {
|
|
private lazy var profileCell: ContactCell = {
|
|
- let cell = ContactCell(style: .default, reuseIdentifier: "profile_cell")
|
|
|
|
- let cellViewModel = ProfileViewModell(context: dcContext)
|
|
|
|
|
|
+ let cell = ContactCell(style: .default, reuseIdentifier: nil)
|
|
|
|
+ let cellViewModel = ProfileViewModel(context: dcContext)
|
|
cell.updateCell(cellViewModel: cellViewModel)
|
|
cell.updateCell(cellViewModel: cellViewModel)
|
|
cell.tag = CellTags.profile.rawValue
|
|
cell.tag = CellTags.profile.rawValue
|
|
cell.accessoryType = .disclosureIndicator
|
|
cell.accessoryType = .disclosureIndicator
|
|
return cell
|
|
return cell
|
|
}()
|
|
}()
|
|
|
|
|
|
- private var contactRequestCell: UITableViewCell = {
|
|
|
|
|
|
+ private lazy var contactRequestCell: UITableViewCell = {
|
|
let cell = UITableViewCell(style: .default, reuseIdentifier: nil)
|
|
let cell = UITableViewCell(style: .default, reuseIdentifier: nil)
|
|
cell.tag = CellTags.contactRequest.rawValue
|
|
cell.tag = CellTags.contactRequest.rawValue
|
|
cell.textLabel?.text = String.localized("menu_deaddrop")
|
|
cell.textLabel?.text = String.localized("menu_deaddrop")
|
|
@@ -62,7 +62,7 @@ internal final class SettingsViewController: UITableViewController, ProgressAler
|
|
return cell
|
|
return cell
|
|
}()
|
|
}()
|
|
|
|
|
|
- private var blockedContactsCell: UITableViewCell = {
|
|
|
|
|
|
+ private lazy var blockedContactsCell: UITableViewCell = {
|
|
let cell = UITableViewCell(style: .default, reuseIdentifier: nil)
|
|
let cell = UITableViewCell(style: .default, reuseIdentifier: nil)
|
|
cell.tag = CellTags.blockedContacts.rawValue
|
|
cell.tag = CellTags.blockedContacts.rawValue
|
|
cell.textLabel?.text = String.localized("pref_blocked_contacts")
|
|
cell.textLabel?.text = String.localized("pref_blocked_contacts")
|
|
@@ -98,7 +98,7 @@ internal final class SettingsViewController: UITableViewController, ProgressAler
|
|
return cell
|
|
return cell
|
|
}()
|
|
}()
|
|
|
|
|
|
- private var notificationSwitch: UISwitch = {
|
|
|
|
|
|
+ private lazy var notificationSwitch: UISwitch = {
|
|
let switchControl = UISwitch()
|
|
let switchControl = UISwitch()
|
|
switchControl.isOn = !UserDefaults.standard.bool(forKey: "notifications_disabled")
|
|
switchControl.isOn = !UserDefaults.standard.bool(forKey: "notifications_disabled")
|
|
switchControl.addTarget(self, action: #selector(handleNotificationToggle(_:)), for: .valueChanged)
|
|
switchControl.addTarget(self, action: #selector(handleNotificationToggle(_:)), for: .valueChanged)
|
|
@@ -146,7 +146,7 @@ internal final class SettingsViewController: UITableViewController, ProgressAler
|
|
return cell
|
|
return cell
|
|
}()
|
|
}()
|
|
|
|
|
|
- private var sendAutocryptMessageCell: ActionCell = {
|
|
|
|
|
|
+ private lazy var sendAutocryptMessageCell: ActionCell = {
|
|
let cell = ActionCell()
|
|
let cell = ActionCell()
|
|
cell.tag = CellTags.sendAutocryptMessage.rawValue
|
|
cell.tag = CellTags.sendAutocryptMessage.rawValue
|
|
cell.actionTitle = String.localized("autocrypt_send_asm_title")
|
|
cell.actionTitle = String.localized("autocrypt_send_asm_title")
|
|
@@ -154,7 +154,7 @@ internal final class SettingsViewController: UITableViewController, ProgressAler
|
|
return cell
|
|
return cell
|
|
}()
|
|
}()
|
|
|
|
|
|
- private var exportBackupCell: ActionCell = {
|
|
|
|
|
|
+ private lazy var exportBackupCell: ActionCell = {
|
|
let cell = ActionCell()
|
|
let cell = ActionCell()
|
|
cell.tag = CellTags.exportBackup.rawValue
|
|
cell.tag = CellTags.exportBackup.rawValue
|
|
cell.actionTitle = String.localized("export_backup_desktop")
|
|
cell.actionTitle = String.localized("export_backup_desktop")
|
|
@@ -162,7 +162,7 @@ internal final class SettingsViewController: UITableViewController, ProgressAler
|
|
return cell
|
|
return cell
|
|
}()
|
|
}()
|
|
|
|
|
|
- private var advancedCell: ActionCell = {
|
|
|
|
|
|
+ private lazy var advancedCell: ActionCell = {
|
|
let cell = ActionCell()
|
|
let cell = ActionCell()
|
|
cell.tag = CellTags.advanced.rawValue
|
|
cell.tag = CellTags.advanced.rawValue
|
|
cell.actionTitle = String.localized("menu_advanced")
|
|
cell.actionTitle = String.localized("menu_advanced")
|
|
@@ -170,7 +170,7 @@ internal final class SettingsViewController: UITableViewController, ProgressAler
|
|
return cell
|
|
return cell
|
|
}()
|
|
}()
|
|
|
|
|
|
- private var helpCell: ActionCell = {
|
|
|
|
|
|
+ private lazy var helpCell: ActionCell = {
|
|
let cell = ActionCell()
|
|
let cell = ActionCell()
|
|
cell.tag = CellTags.help.rawValue
|
|
cell.tag = CellTags.help.rawValue
|
|
cell.actionTitle = String.localized("menu_help")
|
|
cell.actionTitle = String.localized("menu_help")
|
|
@@ -436,7 +436,7 @@ internal final class SettingsViewController: UITableViewController, ProgressAler
|
|
|
|
|
|
// MARK: - updates
|
|
// MARK: - updates
|
|
private func updateCells() {
|
|
private func updateCells() {
|
|
- profileCell.updateCell(cellViewModel: ProfileViewModell(context: dcContext))
|
|
|
|
|
|
+ profileCell.updateCell(cellViewModel: ProfileViewModel(context: dcContext))
|
|
showEmailsCell.detailTextLabel?.text = SettingsClassicViewController.getValString(val: dcContext.showEmails)
|
|
showEmailsCell.detailTextLabel?.text = SettingsClassicViewController.getValString(val: dcContext.showEmails)
|
|
mediaQualityCell.detailTextLabel?.text = MediaQualityController.getValString(val: dcContext.getConfigInt("media_quality"))
|
|
mediaQualityCell.detailTextLabel?.text = MediaQualityController.getValString(val: dcContext.getConfigInt("media_quality"))
|
|
autodelCell.detailTextLabel?.text = autodelSummary()
|
|
autodelCell.detailTextLabel?.text = autodelSummary()
|