|
@@ -25,9 +25,8 @@ class AccountSetupController: UITableViewController, ProgressAlertHandler {
|
|
|
private let tagSmtpPasswordCell = 10
|
|
|
private let tagSmtpSecurityCell = 11
|
|
|
private let tagCertCheckCell = 12
|
|
|
- private let tagEmptyServerCell = 13
|
|
|
- private let tagDeleteAccountCell = 14
|
|
|
- private let tagRestoreCell = 15
|
|
|
+ private let tagDeleteAccountCell = 13
|
|
|
+ private let tagRestoreCell = 14
|
|
|
|
|
|
private let tagTextFieldEmail = 100
|
|
|
private let tagTextFieldPassword = 200
|
|
@@ -62,7 +61,7 @@ class AccountSetupController: UITableViewController, ProgressAlertHandler {
|
|
|
certCheckCell
|
|
|
]
|
|
|
private lazy var folderCells: [UITableViewCell] = [inboxWatchCell, sentboxWatchCell, mvboxWatchCell, sendCopyToSelfCell, mvboxMoveCell]
|
|
|
- private lazy var dangerCells: [UITableViewCell] = [emptyServerCell, deleteAccountCell]
|
|
|
+ private lazy var dangerCells: [UITableViewCell] = [deleteAccountCell]
|
|
|
private let editView: Bool
|
|
|
private var advancedSectionShowing: Bool = false
|
|
|
private var providerInfoShowing: Bool = false
|
|
@@ -111,14 +110,6 @@ class AccountSetupController: UITableViewController, ProgressAlertHandler {
|
|
|
return cell
|
|
|
}()
|
|
|
|
|
|
- private lazy var emptyServerCell: ActionCell = {
|
|
|
- let cell = ActionCell(frame: .zero)
|
|
|
- cell.actionTitle = String.localized("pref_empty_server_title")
|
|
|
- cell.actionColor = UIColor.red
|
|
|
- cell.tag = tagEmptyServerCell
|
|
|
- return cell
|
|
|
- }()
|
|
|
-
|
|
|
private lazy var deleteAccountCell: ActionCell = {
|
|
|
let cell = ActionCell(frame: .zero)
|
|
|
cell.actionTitle = String.localized("delete_account")
|
|
@@ -475,8 +466,6 @@ class AccountSetupController: UITableViewController, ProgressAlertHandler {
|
|
|
case tagRestoreCell:
|
|
|
tableView.reloadData() // otherwise the disclosureIndicator may stay selected
|
|
|
restoreBackup()
|
|
|
- case tagEmptyServerCell:
|
|
|
- emptyServer()
|
|
|
case tagDeleteAccountCell:
|
|
|
deleteAccount()
|
|
|
case tagAdvancedCell:
|
|
@@ -753,30 +742,6 @@ class AccountSetupController: UITableViewController, ProgressAlertHandler {
|
|
|
logger.error("no documents directory found")
|
|
|
}
|
|
|
|
|
|
- private func emptyServer() {
|
|
|
- let alert = UIAlertController(title: String.localized("pref_empty_server_title"),
|
|
|
- message: String.localized("pref_empty_server_msg"), preferredStyle: .safeActionSheet)
|
|
|
- alert.addAction(UIAlertAction(title: String.localized("pref_empty_server_inbox"), style: .destructive, handler: { _ in
|
|
|
- self.emptyServer2ndConfirm(title: String.localized("pref_empty_server_inbox"), flags: Int(DC_EMPTY_INBOX))
|
|
|
- }))
|
|
|
- alert.addAction(UIAlertAction(title: String.localized("pref_empty_server_mvbox"), style: .destructive, handler: { _ in
|
|
|
- self.emptyServer2ndConfirm(title: String.localized("pref_empty_server_mvbox"), flags: Int(DC_EMPTY_MVBOX))
|
|
|
- }))
|
|
|
- alert.addAction(UIAlertAction(title: String.localized("cancel"), style: .cancel))
|
|
|
- present(alert, animated: true, completion: nil)
|
|
|
- }
|
|
|
-
|
|
|
- private func emptyServer2ndConfirm(title: String, flags: Int) {
|
|
|
- let alert = UIAlertController(
|
|
|
- title: title,
|
|
|
- message: String.localized("pref_empty_server_msg"), preferredStyle: .alert)
|
|
|
- alert.addAction(UIAlertAction(title: String.localized("pref_empty_server_do_button"), style: .destructive, handler: { _ in
|
|
|
- self.dcContext.emptyServer(flags: flags)
|
|
|
- }))
|
|
|
- alert.addAction(UIAlertAction(title: String.localized("cancel"), style: .cancel))
|
|
|
- present(alert, animated: true, completion: nil)
|
|
|
- }
|
|
|
-
|
|
|
private func deleteAccount() {
|
|
|
guard let appDelegate = UIApplication.shared.delegate as? AppDelegate else {
|
|
|
return
|