Name classes consistently
* Settings are called *SettingsTableViewController * Key importers are called *ImportTableViewController * Classes in UserInterface folder are split into Controllers or Views
This commit is contained in:
parent
20f18d0c8b
commit
3cdf77347a
14 changed files with 60 additions and 68 deletions
|
|
@ -82,7 +82,7 @@ class AdvancedSettingsTableViewController: UITableViewController {
|
|||
}
|
||||
|
||||
@IBAction func saveGitConfigSetting(segue: UIStoryboardSegue) {
|
||||
if let controller = segue.source as? GitConfigSettingTableViewController {
|
||||
if let controller = segue.source as? GitConfigSettingsTableViewController {
|
||||
if let gitSignatureName = controller.nameTextField.text,
|
||||
let gitSignatureEmail = controller.emailTextField.text {
|
||||
Defaults.gitSignatureName = gitSignatureName.isEmpty ? nil : gitSignatureName
|
||||
|
|
|
|||
17
pass/Controllers/AutoCellHeightUITableViewController.swift
Normal file
17
pass/Controllers/AutoCellHeightUITableViewController.swift
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// AutoCellHeightUITableViewController.swift
|
||||
// pass
|
||||
//
|
||||
// Created by Danny Moesch on 17.02.19.
|
||||
// Copyright © 2019 Bob Sun. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class AutoCellHeightUITableViewController: UITableViewController {
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
tableView.estimatedRowHeight = 170
|
||||
tableView.rowHeight = UITableView.automaticDimension
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// GitConfigSettingTableViewController.swift
|
||||
// GitConfigSettingsTableViewController.swift
|
||||
// pass
|
||||
//
|
||||
// Created by Yishi Lin on 10/4/17.
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
import UIKit
|
||||
import passKit
|
||||
|
||||
class GitConfigSettingTableViewController: UITableViewController {
|
||||
class GitConfigSettingsTableViewController: UITableViewController {
|
||||
let passwordStore = PasswordStore.shared
|
||||
|
||||
@IBOutlet weak var nameTextField: UITextField!
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// GitServerSettingTableViewController.swift
|
||||
// GitRepositorySettingsTableViewController.swift
|
||||
// pass
|
||||
//
|
||||
// Created by Mingshen Sun on 21/1/2017.
|
||||
|
|
@ -11,7 +11,7 @@ import SVProgressHUD
|
|||
import passKit
|
||||
|
||||
|
||||
class GitServerSettingTableViewController: UITableViewController {
|
||||
class GitRepositorySettingsTableViewController: UITableViewController {
|
||||
// MARK: - View Outlet
|
||||
|
||||
@IBOutlet weak var gitURLTextField: UITextField!
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// PGPKeyArmorSettingTableViewController.swift
|
||||
// PGPKeyArmorImportTableViewController.swift
|
||||
// pass
|
||||
//
|
||||
// Created by Mingshen Sun on 17/2/2017.
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
import UIKit
|
||||
import passKit
|
||||
|
||||
class PGPKeyArmorSettingTableViewController: AutoCellHeightUITableViewController, UITextViewDelegate, QRScannerControllerDelegate {
|
||||
class PGPKeyArmorImportTableViewController: AutoCellHeightUITableViewController, UITextViewDelegate, QRScannerControllerDelegate {
|
||||
@IBOutlet weak var armorPublicKeyTextView: UITextView!
|
||||
@IBOutlet weak var armorPrivateKeyTextView: UITextView!
|
||||
@IBOutlet weak var scanPublicKeyCell: UITableViewCell!
|
||||
|
|
@ -130,7 +130,7 @@ class PGPKeyArmorSettingTableViewController: AutoCellHeightUITableViewController
|
|||
}
|
||||
}
|
||||
|
||||
extension PGPKeyArmorSettingTableViewController: PGPKeyImporter {
|
||||
extension PGPKeyArmorImportTableViewController: PGPKeyImporter {
|
||||
|
||||
static let keySource = PGPKeySource.armor
|
||||
static let label = "AsciiArmorEncryptedKey".localize()
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// PGPKeyFileSettingTableViewController.swift
|
||||
// PGPKeyFileImportTableViewController.swift
|
||||
// pass
|
||||
//
|
||||
// Created by Danny Moesch on 01.02.20.
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import passKit
|
||||
|
||||
class PGPKeyFileSettingTableViewController: AutoCellHeightUITableViewController {
|
||||
class PGPKeyFileImportTableViewController: AutoCellHeightUITableViewController {
|
||||
|
||||
@IBOutlet weak var pgpPublicKeyFile: UITableViewCell!
|
||||
@IBOutlet weak var pgpPrivateKeyFile: UITableViewCell!
|
||||
|
|
@ -45,7 +45,7 @@ class PGPKeyFileSettingTableViewController: AutoCellHeightUITableViewController
|
|||
}
|
||||
}
|
||||
|
||||
extension PGPKeyFileSettingTableViewController: UIDocumentPickerDelegate {
|
||||
extension PGPKeyFileImportTableViewController: UIDocumentPickerDelegate {
|
||||
|
||||
func documentPicker(_: UIDocumentPickerViewController, didPickDocumentsAt url: [URL]) {
|
||||
guard let url = url.first else {
|
||||
|
|
@ -70,7 +70,7 @@ extension PGPKeyFileSettingTableViewController: UIDocumentPickerDelegate {
|
|||
}
|
||||
}
|
||||
|
||||
extension PGPKeyFileSettingTableViewController: PGPKeyImporter {
|
||||
extension PGPKeyFileImportTableViewController: PGPKeyImporter {
|
||||
|
||||
static let keySource = PGPKeySource.files
|
||||
static let label = "LoadFromFiles".localize()
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// PGPKeyUrlTableViewController.swift
|
||||
// PGPKeyUrlImportTableViewController.swift
|
||||
// pass
|
||||
//
|
||||
// Created by Mingshen Sun on 21/1/2017.
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
import UIKit
|
||||
import passKit
|
||||
|
||||
class PGPKeyUrlTableViewController: AutoCellHeightUITableViewController {
|
||||
class PGPKeyUrlImportTableViewController: AutoCellHeightUITableViewController {
|
||||
|
||||
@IBOutlet weak var pgpPublicKeyURLTextField: UITextField!
|
||||
@IBOutlet weak var pgpPrivateKeyURLTextField: UITextField!
|
||||
|
|
@ -44,7 +44,7 @@ class PGPKeyUrlTableViewController: AutoCellHeightUITableViewController {
|
|||
}
|
||||
}
|
||||
|
||||
extension PGPKeyUrlTableViewController: PGPKeyImporter {
|
||||
extension PGPKeyUrlImportTableViewController: PGPKeyImporter {
|
||||
|
||||
static let keySource = PGPKeySource.url
|
||||
static let label = "DownloadFromUrl".localize()
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// GitSSHKeyArmorSettingTableViewController.swift
|
||||
// SSHKeyArmorImportTableViewController.swift
|
||||
// pass
|
||||
//
|
||||
// Created by Mingshen Sun on 2/4/2017.
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
import UIKit
|
||||
import passKit
|
||||
|
||||
class GitSSHKeyArmorSettingTableViewController: AutoCellHeightUITableViewController, UITextViewDelegate, QRScannerControllerDelegate {
|
||||
class SSHKeyArmorImportTableViewController: AutoCellHeightUITableViewController, UITextViewDelegate, QRScannerControllerDelegate {
|
||||
@IBOutlet weak var armorPrivateKeyTextView: UITextView!
|
||||
@IBOutlet weak var scanPrivateKeyCell: UITableViewCell!
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// SSHKeySettingTableViewController.swift
|
||||
// SSHKeyUrlImportTableViewController.swift
|
||||
// pass
|
||||
//
|
||||
// Created by Mingshen Sun on 25/1/2017.
|
||||
|
|
@ -10,7 +10,7 @@ import UIKit
|
|||
import SVProgressHUD
|
||||
import passKit
|
||||
|
||||
class SSHKeySettingTableViewController: AutoCellHeightUITableViewController {
|
||||
class SSHKeyUrlImportTableViewController: AutoCellHeightUITableViewController {
|
||||
|
||||
@IBOutlet weak var privateKeyURLTextField: UITextField!
|
||||
|
||||
|
|
@ -130,13 +130,13 @@ class SettingsTableViewController: UITableViewController, UITabBarControllerDele
|
|||
|
||||
func showPGPKeyActionSheet() {
|
||||
let optionMenu = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
|
||||
optionMenu.addAction(UIAlertAction(title: PGPKeyUrlTableViewController.menuLabel, style: .default) { _ in
|
||||
optionMenu.addAction(UIAlertAction(title: PGPKeyUrlImportTableViewController.menuLabel, style: .default) { _ in
|
||||
self.performSegue(withIdentifier: "setPGPKeyByURLSegue", sender: self)
|
||||
})
|
||||
optionMenu.addAction(UIAlertAction(title: PGPKeyArmorSettingTableViewController.menuLabel, style: .default) { _ in
|
||||
optionMenu.addAction(UIAlertAction(title: PGPKeyArmorImportTableViewController.menuLabel, style: .default) { _ in
|
||||
self.performSegue(withIdentifier: "setPGPKeyByASCIISegue", sender: self)
|
||||
})
|
||||
optionMenu.addAction(UIAlertAction(title: PGPKeyFileSettingTableViewController.menuLabel, style: .default) { _ in
|
||||
optionMenu.addAction(UIAlertAction(title: PGPKeyFileImportTableViewController.menuLabel, style: .default) { _ in
|
||||
self.performSegue(withIdentifier: "setPGPKeyByFileSegue", sender: self)
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue