diff --git a/enzevalos_iphone.xcodeproj/project.pbxproj b/enzevalos_iphone.xcodeproj/project.pbxproj index 7dd4be458cd0e5332ab32d61fa87690670b9865b..a47f5f7f3fa9f01c75a9407c07d6994be2348271 100644 --- a/enzevalos_iphone.xcodeproj/project.pbxproj +++ b/enzevalos_iphone.xcodeproj/project.pbxproj @@ -49,7 +49,7 @@ 4751C6FC2344C8D1006B2A4D /* KeyTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4751C6FB2344C8D1006B2A4D /* KeyTableViewController.swift */; }; 4751C7002344D37C006B2A4D /* SecretKey+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4751C6FE2344D37C006B2A4D /* SecretKey+CoreDataClass.swift */; }; 4751C7012344D37C006B2A4D /* SecretKey+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4751C6FF2344D37C006B2A4D /* SecretKey+CoreDataProperties.swift */; }; - 4751C70323464C81006B2A4D /* ImportKeyOverviewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4751C70223464C80006B2A4D /* ImportKeyOverviewController.swift */; }; + 4751C70523474525006B2A4D /* ImportKeyOverviewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4751C70423474525006B2A4D /* ImportKeyOverviewController.swift */; }; 4756DE0E20402F8E00452288 /* invitationTextCensor.html in Resources */ = {isa = PBXBuildFile; fileRef = 4756DE0D20402F8E00452288 /* invitationTextCensor.html */; }; 475B00331F7B9565006CDD41 /* SwiftPGP.swift in Sources */ = {isa = PBXBuildFile; fileRef = 475B00301F7B9565006CDD41 /* SwiftPGP.swift */; }; 475B00341F7B9565006CDD41 /* Cryptography.swift in Sources */ = {isa = PBXBuildFile; fileRef = 475B00311F7B9565006CDD41 /* Cryptography.swift */; }; @@ -302,7 +302,7 @@ 4751C6FD2344D169006B2A4D /* enzevalos_iphone 8.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "enzevalos_iphone 8.xcdatamodel"; sourceTree = "<group>"; }; 4751C6FE2344D37C006B2A4D /* SecretKey+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SecretKey+CoreDataClass.swift"; sourceTree = "<group>"; }; 4751C6FF2344D37C006B2A4D /* SecretKey+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SecretKey+CoreDataProperties.swift"; sourceTree = "<group>"; }; - 4751C70223464C80006B2A4D /* ImportKeyOverviewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ImportKeyOverviewController.swift; path = /Users/Olli/enzevalos/test2/enzevalos_iphone/enzevalos_iphone/ImportKeyOverviewController.swift; sourceTree = "<absolute>"; }; + 4751C70423474525006B2A4D /* ImportKeyOverviewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImportKeyOverviewController.swift; sourceTree = "<group>"; }; 4756DE0D20402F8E00452288 /* invitationTextCensor.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = invitationTextCensor.html; path = Invitation/invitationTextCensor.html; sourceTree = "<group>"; }; 475B00301F7B9565006CDD41 /* SwiftPGP.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftPGP.swift; sourceTree = "<group>"; }; 475B00311F7B9565006CDD41 /* Cryptography.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Cryptography.swift; sourceTree = "<group>"; }; @@ -1049,7 +1049,6 @@ A1D5076D1E80254D00B68B38 /* keyView */ = { isa = PBXGroup; children = ( - 4751C70223464C80006B2A4D /* ImportKeyOverviewController.swift */, 4751C6F923449699006B2A4D /* CryptoManagementViewController.swift */, A1D5076E1E80257A00B68B38 /* KeyViewController.swift */, 477670C3228453FB00043604 /* ButtonCell.xib */, @@ -1059,6 +1058,7 @@ 47E737732284610E00972401 /* KeyCell.xib */, 47E737752284632F00972401 /* KeyCell.swift */, 4751C6FB2344C8D1006B2A4D /* KeyTableViewController.swift */, + 4751C70423474525006B2A4D /* ImportKeyOverviewController.swift */, ); name = keyView; sourceTree = "<group>"; @@ -1557,7 +1557,7 @@ 4707096D1F8F9F4900657F41 /* ExportViewController.swift in Sources */, F12060801DA540FE00F6EF37 /* RefreshControlExtension.swift in Sources */, 4751C6FC2344C8D1006B2A4D /* KeyTableViewController.swift in Sources */, - 4751C70323464C81006B2A4D /* ImportKeyOverviewController.swift in Sources */, + 4751C70523474525006B2A4D /* ImportKeyOverviewController.swift in Sources */, A13526811D955BDF00D3BFE1 /* enzevalos_iphone.xcdatamodeld in Sources */, 472F39821E1E5347009260FB /* Mail_Address+CoreDataProperties.swift in Sources */, 477548E221F77466000B22A8 /* SecurityIndicator.swift in Sources */, diff --git a/enzevalos_iphone/Base.lproj/Main.storyboard b/enzevalos_iphone/Base.lproj/Main.storyboard index 6a9d7bb39f48f2a04c54ff3c3ce4d9bc3afc2808..b66bb1fbc1957859dcf2d826d3794beb1e2da9a5 100644 --- a/enzevalos_iphone/Base.lproj/Main.storyboard +++ b/enzevalos_iphone/Base.lproj/Main.storyboard @@ -566,7 +566,7 @@ <!--Key Table View Controller--> <scene sceneID="bHW-51-a9S"> <objects> - <tableViewController restorationIdentifier="KeyListViewController" storyboardIdentifier="KeyListViewController" id="RgH-L9-huP" customClass="KeyTableViewController" customModule="enzevalos_iphone" customModuleProvider="target" sceneMemberID="viewController"> + <tableViewController storyboardIdentifier="KeyListViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="RgH-L9-huP" customClass="KeyTableViewController" customModule="enzevalos_iphone" customModuleProvider="target" sceneMemberID="viewController"> <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" id="fNn-RC-Nym"> <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> @@ -594,7 +594,7 @@ <!--Import Key Overview Controller--> <scene sceneID="hig-sG-hkl"> <objects> - <tableViewController storyboardIdentifier="ImportKeyOverview" useStoryboardIdentifierAsRestorationIdentifier="YES" id="6Ib-ya-r4X" customClass="ImportKeyOverviewController" sceneMemberID="viewController"> + <tableViewController storyboardIdentifier="ImportKeyOverview" useStoryboardIdentifierAsRestorationIdentifier="YES" id="6Ib-ya-r4X" customClass="ImportKeyOverviewController" customModule="enzevalos_iphone" customModuleProvider="target" sceneMemberID="viewController"> <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" id="0W5-nq-uJy"> <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> @@ -914,7 +914,7 @@ <objects> <tableViewController storyboardIdentifier="UITableViewController-8Di-x2-cWQ" useStoryboardIdentifierAsRestorationIdentifier="YES" id="8Di-x2-cWQ" customClass="ContactViewController" customModule="enzevalos_iphone" customModuleProvider="target" sceneMemberID="viewController"> <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="18" sectionFooterHeight="18" id="lK7-ug-OyQ"> - <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> + <rect key="frame" x="0.0" y="0.0" width="414" height="808"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/> <prototypes> @@ -1290,7 +1290,7 @@ <rect key="frame" x="0.0" y="809.33333333333337" width="414" height="44"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="hTc-vs-AIl" id="pJ9-4e-7at"> - <rect key="frame" x="0.0" y="0.0" width="376" height="43.666666666666664"/> + <rect key="frame" x="0.0" y="0.0" width="388" height="43.666666666666664"/> <autoresizingMask key="autoresizingMask"/> <subviews> <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Ll6-yF-xkq"> @@ -1542,7 +1542,7 @@ <objects> <tableViewController storyboardIdentifier="exportInfoViewController" id="7Pd-d5-0wz" customClass="ExportInfoViewController" customModule="enzevalos_iphone" customModuleProvider="target" sceneMemberID="viewController"> <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" dataMode="prototypes" style="grouped" separatorStyle="default" sectionIndexMinimumDisplayRowCount="1" rowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" id="2Uv-bd-pB1"> - <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> + <rect key="frame" x="0.0" y="0.0" width="414" height="808"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/> <prototypes> diff --git a/enzevalos_iphone/ImportKeyOverviewController.swift b/enzevalos_iphone/ImportKeyOverviewController.swift index 652daa1ec7dc1654a93a966b8b2494f3cb296533..16007b53cd8e398be0fa799ef9f44def7d188cf5 100644 --- a/enzevalos_iphone/ImportKeyOverviewController.swift +++ b/enzevalos_iphone/ImportKeyOverviewController.swift @@ -1,34 +1,29 @@ // // ImportKeyOverviewController.swift -// +// enzevalos_iphone // -// Created by Oliver Wiese on 03.10.19. +// Created by Oliver Wiese on 04.10.19. +// Copyright © 2019 fu-berlin. All rights reserved. // import UIKit class ImportKeyOverviewController: UITableViewController { - + override func viewDidLoad() { super.viewDidLoad() - - // Uncomment the following line to preserve selection between presentations - // self.clearsSelectionOnViewWillAppear = false - - // Uncomment the following line to display an Edit button in the navigation bar for this view controller. - // self.navigationItem.rightBarButtonItem = self.editButtonItem } - + // MARK: - Table view data source - + override func numberOfSections(in tableView: UITableView) -> Int { return 3 } - + override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 1 } - + override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { var identifier = "InfoText" @@ -47,10 +42,10 @@ class ImportKeyOverviewController: UITableViewController { // cell.listener = self // copyButton = cell return cell - + } - + } else { // paste import identifier = "PasteButton" @@ -68,50 +63,50 @@ class ImportKeyOverviewController: UITableViewController { return cell } - + /* - // Override to support conditional editing of the table view. - override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { - // Return false if you do not want the specified item to be editable. - return true - } - */ - + // Override to support conditional editing of the table view. + override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { + // Return false if you do not want the specified item to be editable. + return true + } + */ + /* - // Override to support editing the table view. - override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) { - if editingStyle == .delete { - // Delete the row from the data source - tableView.deleteRows(at: [indexPath], with: .fade) - } else if editingStyle == .insert { - // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view - } - } - */ - + // Override to support editing the table view. + override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) { + if editingStyle == .delete { + // Delete the row from the data source + tableView.deleteRows(at: [indexPath], with: .fade) + } else if editingStyle == .insert { + // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view + } + } + */ + /* - // Override to support rearranging the table view. - override func tableView(_ tableView: UITableView, moveRowAt fromIndexPath: IndexPath, to: IndexPath) { - - } - */ - + // Override to support rearranging the table view. + override func tableView(_ tableView: UITableView, moveRowAt fromIndexPath: IndexPath, to: IndexPath) { + + } + */ + /* - // Override to support conditional rearranging of the table view. - override func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool { - // Return false if you do not want the item to be re-orderable. - return true - } - */ - + // Override to support conditional rearranging of the table view. + override func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool { + // Return false if you do not want the item to be re-orderable. + return true + } + */ + /* - // MARK: - Navigation - - // In a storyboard-based application, you will often want to do a little preparation before navigation - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { - // Get the new view controller using segue.destination. - // Pass the selected object to the new view controller. - } - */ - + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + // Get the new view controller using segue.destination. + // Pass the selected object to the new view controller. + } + */ + } diff --git a/enzevalos_iphone/KeyTableViewController.swift b/enzevalos_iphone/KeyTableViewController.swift index b540a816294adf8bfd3ab744a40d00b4547075e8..98b00f70cfed2c9cc1a73f48b9a6fd463d2bbef7 100644 --- a/enzevalos_iphone/KeyTableViewController.swift +++ b/enzevalos_iphone/KeyTableViewController.swift @@ -25,7 +25,17 @@ class KeyTableViewController: UITableViewController { title = "Other people's IDs" } self.title = title - self.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .add, target: nil, action: nil) + self.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(addButton(btn:))) + } + + + @objc private func addButton(btn: UIBarButtonItem) { + if !showYourIDs { + let mainStoryboard = UIStoryboard(name: "Main", bundle: Bundle.main) + if let viewController = mainStoryboard.instantiateViewController(withIdentifier: "ImportKeyOverview") as? ImportKeyOverviewController { + self.navigationController?.pushViewController(viewController, animated: true) + } + } } // MARK: - Table view data source @@ -91,6 +101,5 @@ class KeyTableViewController: UITableViewController { } tableView.cellForRow(at: indexPath)?.selectionStyle = .default tableView.reloadRows(at: [indexPath], with: .automatic) - } } diff --git a/enzevalos_iphone/de.lproj/Localizable.strings b/enzevalos_iphone/de.lproj/Localizable.strings index 018d883bcd9b2492ab96d0be5e236ced8da9f9fe..2cb6468868347e3a1f0301294dc788d5ae3e80b4 100644 --- a/enzevalos_iphone/de.lproj/Localizable.strings +++ b/enzevalos_iphone/de.lproj/Localizable.strings @@ -302,3 +302,5 @@ "Time.Day.Multiple" = "%d Tage"; "Time.Day.Today" = "heute"; "Management.Crypto.Title" = "Management"; +"Import.Button.Paste" = "Einfügen eines Schlüssels"; +"Import.Button.Itunes" = "Übertragung mittels iTunes"; diff --git a/enzevalos_iphone/en.lproj/Localizable.strings b/enzevalos_iphone/en.lproj/Localizable.strings index e6c606d8bee1ceacc52fe8693c21822a847b25bf..2d82ea5fc68c125ef40867267657a29f26024995 100644 --- a/enzevalos_iphone/en.lproj/Localizable.strings +++ b/enzevalos_iphone/en.lproj/Localizable.strings @@ -271,3 +271,5 @@ "Time.Day.Multiple" = "%d days"; "Time.Day.Today" = "today"; "Management.Crypto.Title" = "Management"; +"Import.Button.Paste" = "Paste a key"; +"Import.Button.Itunes" = "Transfer via iTunes";