Remove pwd flavor selector from settings
User's latest selection in the add/edit page will be remembered.
This commit is contained in:
parent
fe21f1c8da
commit
5e4fbaec8a
1 changed files with 2 additions and 41 deletions
|
|
@ -70,15 +70,12 @@ class GeneralSettingsTableViewController: BasicStaticTableViewController {
|
||||||
[[.title: "AboutRepository".localize(), .action: "segue", .link: "showAboutRepositorySegue"],],
|
[[.title: "AboutRepository".localize(), .action: "segue", .link: "showAboutRepositorySegue"],],
|
||||||
|
|
||||||
// section 1
|
// section 1
|
||||||
[
|
|
||||||
[.title: "PasswordGeneratorFlavor".localize(), .action: "none", .style: CellDataStyle.value1],
|
|
||||||
],
|
|
||||||
|
|
||||||
// section 2
|
|
||||||
[
|
[
|
||||||
[.title: "RememberPgpKeyPassphrase".localize(), .action: "none",],
|
[.title: "RememberPgpKeyPassphrase".localize(), .action: "none",],
|
||||||
[.title: "RememberGitCredentialPassphrase".localize(), .action: "none",],
|
[.title: "RememberGitCredentialPassphrase".localize(), .action: "none",],
|
||||||
],
|
],
|
||||||
|
|
||||||
|
// section 2
|
||||||
[
|
[
|
||||||
[.title: "ShowFolders".localize(), .action: "none",],
|
[.title: "ShowFolders".localize(), .action: "none",],
|
||||||
[.title: "HidePasswordImages".localize(), .action: "none",],
|
[.title: "HidePasswordImages".localize(), .action: "none",],
|
||||||
|
|
@ -142,47 +139,11 @@ class GeneralSettingsTableViewController: BasicStaticTableViewController {
|
||||||
cell.accessoryView = accessoryView
|
cell.accessoryView = accessoryView
|
||||||
cell.selectionStyle = .none
|
cell.selectionStyle = .none
|
||||||
hidePasswordImagesSwitch.isOn = Defaults.isHidePasswordImagesOn
|
hidePasswordImagesSwitch.isOn = Defaults.isHidePasswordImagesOn
|
||||||
case "PasswordGeneratorFlavor".localize():
|
|
||||||
cell.accessoryType = .disclosureIndicator
|
|
||||||
cell.detailTextLabel?.text = Defaults.passwordGeneratorFlavor.localized
|
|
||||||
default: break
|
default: break
|
||||||
}
|
}
|
||||||
return cell
|
return cell
|
||||||
}
|
}
|
||||||
|
|
||||||
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
|
||||||
super.tableView(tableView, didSelectRowAt: indexPath)
|
|
||||||
let cell = tableView.cellForRow(at: indexPath)!
|
|
||||||
if cell.textLabel!.text! == "PasswordGeneratorFlavor".localize() {
|
|
||||||
tableView.deselectRow(at: indexPath, animated: true)
|
|
||||||
showPasswordGeneratorFlavorActionSheet(sourceCell: cell)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func showPasswordGeneratorFlavorActionSheet(sourceCell: UITableViewCell) {
|
|
||||||
let optionMenu = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
|
|
||||||
|
|
||||||
PasswordGeneratorFlavor.allCases.forEach { flavor in
|
|
||||||
var actionTitle = flavor.longNameLocalized
|
|
||||||
if Defaults.passwordGeneratorFlavor == flavor {
|
|
||||||
actionTitle = "✓ " + actionTitle
|
|
||||||
}
|
|
||||||
let action = UIAlertAction(title: actionTitle, style: .default) { _ in
|
|
||||||
Defaults.passwordGeneratorFlavor = flavor
|
|
||||||
sourceCell.detailTextLabel?.text = Defaults.passwordGeneratorFlavor.localized
|
|
||||||
}
|
|
||||||
optionMenu.addAction(action)
|
|
||||||
}
|
|
||||||
|
|
||||||
let cancelAction = UIAlertAction(title: "Cancel".localize(), style: .cancel, handler: nil)
|
|
||||||
optionMenu.addAction(cancelAction)
|
|
||||||
|
|
||||||
optionMenu.popoverPresentationController?.sourceView = sourceCell
|
|
||||||
optionMenu.popoverPresentationController?.sourceRect = sourceCell.bounds
|
|
||||||
|
|
||||||
self.present(optionMenu, animated: true, completion: nil)
|
|
||||||
}
|
|
||||||
|
|
||||||
@objc func tapHideUnknownSwitchDetailButton(_ sender: Any?) {
|
@objc func tapHideUnknownSwitchDetailButton(_ sender: Any?) {
|
||||||
let alertMessage = "HideUnknownFieldsExplanation.".localize()
|
let alertMessage = "HideUnknownFieldsExplanation.".localize()
|
||||||
let alertTitle = "HideUnknownFields".localize()
|
let alertTitle = "HideUnknownFields".localize()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue