Add ignore .gpg-id switch default ON

This commit is contained in:
Mingshen Sun 2021-01-07 21:58:38 -08:00
parent 6280b1522b
commit a62792bd11
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
9 changed files with 91 additions and 13 deletions

View file

@ -46,6 +46,15 @@ class GeneralSettingsTableViewController: BasicStaticTableViewController {
return uiSwitch
}()
let ignoreGPGIDSwitch: UISwitch = {
let uiSwitch = UISwitch()
uiSwitch.onTintColor = Colors.systemBlue
uiSwitch.sizeToFit()
uiSwitch.addTarget(self, action: #selector(ignoreGPGIDSwitchAction(_:)), for: UIControl.Event.valueChanged)
uiSwitch.isOn = Defaults.isIgnoreGPGIDOn
return uiSwitch
}()
let showFolderSwitch: UISwitch = {
let uiSwitch = UISwitch()
uiSwitch.onTintColor = Colors.systemBlue
@ -77,6 +86,7 @@ class GeneralSettingsTableViewController: BasicStaticTableViewController {
// section 2
[
[.title: "IgnoreGPGID".localize(), .action: "none"],
[.title: "ShowFolders".localize(), .action: "none"],
[.title: "HidePasswordImages".localize(), .action: "none"],
[.title: "HideUnknownFields".localize(), .action: "none"],
@ -129,6 +139,10 @@ class GeneralSettingsTableViewController: BasicStaticTableViewController {
cell.accessoryType = .none
cell.selectionStyle = .none
cell.accessoryView = showFolderSwitch
case "IgnoreGPGID".localize():
cell.accessoryType = .none
cell.selectionStyle = .none
cell.accessoryView = ignoreGPGIDSwitch
case "HidePasswordImages".localize():
cell.accessoryType = .none
let detailButton = UIButton(type: .detailDisclosure)
@ -206,6 +220,11 @@ class GeneralSettingsTableViewController: BasicStaticTableViewController {
NotificationCenter.default.post(name: .passwordDisplaySettingChanged, object: nil)
}
@objc
func ignoreGPGIDSwitchAction(_: Any?) {
Defaults.isIgnoreGPGIDOn = ignoreGPGIDSwitch.isOn
}
@objc
func hidePasswordImagesSwitchAction(_: Any?) {
Defaults.isHidePasswordImagesOn = hidePasswordImagesSwitch.isOn

View file

@ -41,6 +41,7 @@
"PasswordGeneratorFlavor" = "Style";
"RememberPgpKeyPassphrase" = "Remember PGP Key Passphrase";
"RememberGitCredentialPassphrase" = "Remember Git Credential Passphrase";
"IgnoreGPGID" = "Ignore .gpg-id";
"ShowFolders" = "Show Folders";
"HidePasswordImages" = "Hide Password Images";
"HidePasswordImagesExplanation." = "Associated favicon images are loaded and shown based upon the URL associated with an entry. Enable this option to hide these images and prevent them from being loaded.";