Show debug info settings
This commit is contained in:
parent
1c86331d7d
commit
edf4c10c71
@ -77,6 +77,16 @@ class SettingsController: FormViewController {
|
||||
self.logout()
|
||||
}
|
||||
|
||||
+++ Section(NSLocalizedString("Debug", comment: ""))
|
||||
<<< SwitchRow() { row in
|
||||
row.title = NSLocalizedString("Show debug info", comment: "")
|
||||
row.value = Settings.shared.showDebugInfos
|
||||
}.onChange { row in
|
||||
if let val = row.value {
|
||||
Settings.shared.showDebugInfo = val
|
||||
}
|
||||
}
|
||||
|
||||
#if targetEnvironment(macCatalyst)
|
||||
if let beepSection = self.form.sectionBy(tag: "BeepRecordSection") {
|
||||
beepSection.hidden = true
|
||||
|
||||
@ -41,12 +41,20 @@ class Settings {
|
||||
}
|
||||
}
|
||||
|
||||
var showDebugInfo: Bool = false {
|
||||
didSet {
|
||||
Settings.defaults.set(self.recordBeep, forKey: "showDebugInfo")
|
||||
Settings.defaults.synchronize()
|
||||
}
|
||||
}
|
||||
|
||||
init() {
|
||||
UserDefaults.standard.register(defaults: [
|
||||
"recognizeAlternativeOrder": false,
|
||||
"recognizeShortenedNumbers": false,
|
||||
"defaultRegion": "161",
|
||||
"recordBeep": false
|
||||
"recordBeep": false,
|
||||
"showDebugInfo": false
|
||||
])
|
||||
|
||||
self.user = Settings.getUser()
|
||||
@ -54,6 +62,7 @@ class Settings {
|
||||
self.recognizeShortenedNumbers = Settings.defaults.bool(forKey: "recognizeShortenedNumbers")
|
||||
self.defaultRegion = Settings.defaults.string(forKey: "defaultRegion") ?? "161"
|
||||
self.recordBeep = Settings.defaults.bool(forKey: "recordBeep")
|
||||
self.showDebugInfo = Settings.defaults.bool(forKey: "showDebugInfo")
|
||||
}
|
||||
|
||||
private static func getUser() -> User {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user