|
@@ -15,6 +15,8 @@ internal final class AdvancedViewController: UITableViewController, ProgressAler
|
|
case sendAutocryptMessage
|
|
case sendAutocryptMessage
|
|
case exportBackup
|
|
case exportBackup
|
|
case advanced
|
|
case advanced
|
|
|
|
+ case experimentalFeatures
|
|
|
|
+ case viewLog
|
|
case videoChat
|
|
case videoChat
|
|
}
|
|
}
|
|
|
|
|
|
@@ -36,6 +38,14 @@ internal final class AdvancedViewController: UITableViewController, ProgressAler
|
|
return cell
|
|
return cell
|
|
}()
|
|
}()
|
|
|
|
|
|
|
|
+ private lazy var experimentalFeaturesCell: UITableViewCell = {
|
|
|
|
+ let cell = UITableViewCell(style: .value1, reuseIdentifier: nil)
|
|
|
|
+ cell.tag = CellTags.experimentalFeatures.rawValue
|
|
|
|
+ cell.textLabel?.text = String.localized("pref_experimental_features")
|
|
|
|
+ cell.accessoryType = .disclosureIndicator
|
|
|
|
+ return cell
|
|
|
|
+ }()
|
|
|
|
+
|
|
private lazy var autocryptSwitch: UISwitch = {
|
|
private lazy var autocryptSwitch: UISwitch = {
|
|
let switchControl = UISwitch()
|
|
let switchControl = UISwitch()
|
|
switchControl.isOn = dcContext.e2eeEnabled
|
|
switchControl.isOn = dcContext.e2eeEnabled
|
|
@@ -73,6 +83,13 @@ internal final class AdvancedViewController: UITableViewController, ProgressAler
|
|
return cell
|
|
return cell
|
|
}()
|
|
}()
|
|
|
|
|
|
|
|
+ private lazy var viewLogCell: ActionCell = {
|
|
|
|
+ let cell = ActionCell()
|
|
|
|
+ cell.tag = CellTags.viewLog.rawValue
|
|
|
|
+ cell.actionTitle = String.localized("pref_view_log")
|
|
|
|
+ return cell
|
|
|
|
+ }()
|
|
|
|
+
|
|
private lazy var sections: [SectionConfigs] = {
|
|
private lazy var sections: [SectionConfigs] = {
|
|
let backupSection = SectionConfigs(
|
|
let backupSection = SectionConfigs(
|
|
headerTitle: nil,
|
|
headerTitle: nil,
|
|
@@ -83,11 +100,15 @@ internal final class AdvancedViewController: UITableViewController, ProgressAler
|
|
footerTitle: String.localized("autocrypt_explain"),
|
|
footerTitle: String.localized("autocrypt_explain"),
|
|
cells: [autocryptPreferencesCell, sendAutocryptMessageCell]
|
|
cells: [autocryptPreferencesCell, sendAutocryptMessageCell]
|
|
)
|
|
)
|
|
- let experimentalSection = SectionConfigs(
|
|
|
|
|
|
+ let miscSection = SectionConfigs(
|
|
|
|
+ headerTitle: nil,
|
|
|
|
+ footerTitle: nil,
|
|
|
|
+ cells: [experimentalFeaturesCell, videoChatInstanceCell, advancedCell])
|
|
|
|
+ let viewLogSection = SectionConfigs(
|
|
headerTitle: nil,
|
|
headerTitle: nil,
|
|
footerTitle: nil,
|
|
footerTitle: nil,
|
|
- cells: [videoChatInstanceCell, advancedCell])
|
|
|
|
- return [backupSection, autocryptSection, experimentalSection]
|
|
|
|
|
|
+ cells: [viewLogCell])
|
|
|
|
+ return [backupSection, autocryptSection, miscSection, viewLogSection]
|
|
}()
|
|
}()
|
|
|
|
|
|
init(dcAccounts: DcAccounts) {
|
|
init(dcAccounts: DcAccounts) {
|
|
@@ -166,7 +187,9 @@ internal final class AdvancedViewController: UITableViewController, ProgressAler
|
|
case .autocryptPreferences: break
|
|
case .autocryptPreferences: break
|
|
case .sendAutocryptMessage: sendAutocryptSetupMessage()
|
|
case .sendAutocryptMessage: sendAutocryptSetupMessage()
|
|
case .exportBackup: createBackup()
|
|
case .exportBackup: createBackup()
|
|
|
|
+ case .experimentalFeatures: showExperimentalDialog()
|
|
case .advanced: showAdvancedDialog()
|
|
case .advanced: showAdvancedDialog()
|
|
|
|
+ case .viewLog: showLogViewController()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -288,15 +311,6 @@ internal final class AdvancedViewController: UITableViewController, ProgressAler
|
|
self.present(alert, animated: true, completion: nil)
|
|
self.present(alert, animated: true, completion: nil)
|
|
}))
|
|
}))
|
|
|
|
|
|
- alert.addAction(UIAlertAction(title: String.localized("pref_experimental_features"), style: .default, handler: { [weak self] _ in
|
|
|
|
- self?.showExperimentalDialog()
|
|
|
|
- }))
|
|
|
|
-
|
|
|
|
- let logAction = UIAlertAction(title: String.localized("pref_view_log"), style: .default, handler: { [weak self] _ in
|
|
|
|
- guard let self = self else { return }
|
|
|
|
- self.showLogViewController()
|
|
|
|
- })
|
|
|
|
- alert.addAction(logAction)
|
|
|
|
alert.addAction(UIAlertAction(title: String.localized("cancel"), style: .cancel, handler: nil))
|
|
alert.addAction(UIAlertAction(title: String.localized("cancel"), style: .cancel, handler: nil))
|
|
present(alert, animated: true, completion: nil)
|
|
present(alert, animated: true, completion: nil)
|
|
}
|
|
}
|