Add settings screen. Move export as zip to settings screen.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jeroen Leenarts
2018-09-18 21:47:43 +02:00
parent 1c7cf59059
commit 089315ddc5
9 changed files with 255 additions and 43 deletions
+144 -19
View File
@@ -89,16 +89,16 @@
<navigationItem key="navigationItem" title="WireGuard" largeTitleDisplayMode="always" id="j0L-5U-jDs">
<barButtonItem key="backBarButtonItem" title="Tunnels" id="pxL-gR-QXU"/>
<rightBarButtonItems>
<barButtonItem title=" ⚙︎" id="DZP-sp-Hsg">
<connections>
<action selector="showSettings:" destination="kTU-BV-32R" id="UfC-XY-zhW"/>
</connections>
</barButtonItem>
<barButtonItem systemItem="add" id="h2H-H8-3Tn">
<connections>
<action selector="addProvider:" destination="kTU-BV-32R" id="xSg-ap-3Fx"/>
</connections>
</barButtonItem>
<barButtonItem systemItem="action" id="zxB-ao-5JR">
<connections>
<action selector="exportTunnels:" destination="kTU-BV-32R" id="PwM-I1-n6B"/>
</connections>
</barButtonItem>
</rightBarButtonItems>
</navigationItem>
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
@@ -548,27 +548,26 @@
</tableView>
<navigationItem key="navigationItem" title="Tunnel settings" id="PPu-rX-T38">
<rightBarButtonItems>
<barButtonItem title=" ⚙︎" id="Ph6-EV-NlT">
<connections>
<action selector="showSettings:" destination="0VM-73-EPX" id="wx3-3w-OhG"/>
</connections>
</barButtonItem>
<barButtonItem systemItem="save" id="mft-1l-bWa">
<connections>
<action selector="saveTunnelConfiguration:" destination="0VM-73-EPX" id="Hni-0w-hFF"/>
</connections>
</barButtonItem>
<barButtonItem systemItem="action" id="uim-Mz-omJ">
<connections>
<action selector="exportTunnel:" destination="0VM-73-EPX" id="oVI-TL-4o9"/>
</connections>
</barButtonItem>
</rightBarButtonItems>
</navigationItem>
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
<connections>
<outlet property="exportButton" destination="uim-Mz-omJ" id="1Tq-ie-xo7"/>
<outlet property="saveButton" destination="mft-1l-bWa" id="Uif-KZ-isx"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="j96-PK-ghN" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="916" y="-263"/>
<point key="canvasLocation" x="-671" y="-1262"/>
</scene>
<!--Tunnel info-->
<scene sceneID="jJx-Qm-bKA">
@@ -802,11 +801,18 @@
</connections>
</tableView>
<navigationItem key="navigationItem" title="Tunnel info" id="Eh1-Vi-78e">
<barButtonItem key="rightBarButtonItem" systemItem="edit" id="YRj-Ox-eKc">
<connections>
<action selector="editTunnelConfiguration:" destination="h8W-vj-IcI" id="f1k-Y6-4c3"/>
</connections>
</barButtonItem>
<rightBarButtonItems>
<barButtonItem title=" ⚙︎" id="OME-id-5vt">
<connections>
<action selector="showSettings:" destination="h8W-vj-IcI" id="mZN-SL-gZJ"/>
</connections>
</barButtonItem>
<barButtonItem systemItem="edit" id="YRj-Ox-eKc">
<connections>
<action selector="editTunnelConfiguration:" destination="h8W-vj-IcI" id="f1k-Y6-4c3"/>
</connections>
</barButtonItem>
</rightBarButtonItems>
</navigationItem>
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
<connections>
@@ -815,7 +821,7 @@
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="cXx-q2-SBO" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="121" y="-263"/>
<point key="canvasLocation" x="-671" y="-469"/>
</scene>
<!--Scan Code-->
<scene sceneID="gKN-k2-HoW">
@@ -845,7 +851,126 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="TQ2-zp-o40" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="121" y="461"/>
<point key="canvasLocation" x="162" y="793"/>
</scene>
<!--Settings-->
<scene sceneID="LLL-0v-1Z9">
<objects>
<tableViewController storyboardIdentifier="SettingsTableViewController" id="0L2-ND-Twh" customClass="SettingsTableViewController" customModule="WireGuard" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" id="xce-Ka-TsV">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<sections>
<tableViewSection headerTitle="Version Information" id="zRZ-jm-jpm">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" id="4T9-BK-cKk">
<rect key="frame" x="0.0" y="55.5" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="4T9-BK-cKk" id="oh2-fj-cpB">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="WireGuard for iOS" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="9LF-1X-BRX">
<rect key="frame" x="16" y="11.5" width="139" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="(x.y.z)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="64F-sz-1fb">
<rect key="frame" x="313" y="11.5" width="46" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="9LF-1X-BRX" firstAttribute="centerY" secondItem="oh2-fj-cpB" secondAttribute="centerY" id="0vh-j4-spD"/>
<constraint firstItem="64F-sz-1fb" firstAttribute="centerY" secondItem="oh2-fj-cpB" secondAttribute="centerY" id="30t-Be-YBk"/>
<constraint firstItem="64F-sz-1fb" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="9LF-1X-BRX" secondAttribute="trailing" constant="16" id="Nl3-vZ-7lQ"/>
<constraint firstItem="9LF-1X-BRX" firstAttribute="leading" secondItem="oh2-fj-cpB" secondAttribute="leadingMargin" id="atb-WE-sm5"/>
<constraint firstItem="64F-sz-1fb" firstAttribute="trailing" secondItem="oh2-fj-cpB" secondAttribute="trailingMargin" id="omW-fc-mV3"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" id="7To-1u-V41">
<rect key="frame" x="0.0" y="99.5" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="7To-1u-V41" id="R1k-wj-XjQ">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Go userspace backend" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="ZrW-kK-iNG">
<rect key="frame" x="16" y="11.5" width="175.5" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="(x.y.z)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZLF-fc-FG0">
<rect key="frame" x="313" y="11.5" width="46" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="ZLF-fc-FG0" firstAttribute="centerY" secondItem="R1k-wj-XjQ" secondAttribute="centerY" id="COd-8Q-MkD"/>
<constraint firstItem="ZLF-fc-FG0" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="ZrW-kK-iNG" secondAttribute="trailing" constant="16" id="mZA-b5-OXz"/>
<constraint firstItem="ZrW-kK-iNG" firstAttribute="leading" secondItem="R1k-wj-XjQ" secondAttribute="leadingMargin" id="v9L-hc-VeV"/>
<constraint firstItem="ZLF-fc-FG0" firstAttribute="trailing" secondItem="R1k-wj-XjQ" secondAttribute="trailingMargin" id="vbt-K7-zSd"/>
<constraint firstItem="ZrW-kK-iNG" firstAttribute="centerY" secondItem="R1k-wj-XjQ" secondAttribute="centerY" id="zMO-S4-aZv"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
</cells>
</tableViewSection>
<tableViewSection headerTitle="Export" id="A0i-t0-uNU">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" textLabel="Xti-BC-KTP" detailTextLabel="qYk-Nl-mLx" style="IBUITableViewCellStyleSubtitle" id="J1T-67-jcC">
<rect key="frame" x="0.0" y="199.5" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="J1T-67-jcC" id="OTJ-zk-hYF">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Export tunnels to zip file" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Xti-BC-KTP">
<rect key="frame" x="16" y="5" width="185" height="20.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Zip file should be shared with a location for storage." textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="qYk-Nl-mLx">
<rect key="frame" x="16" y="25.5" width="294.5" height="14.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
</cells>
</tableViewSection>
</sections>
<connections>
<outlet property="dataSource" destination="0L2-ND-Twh" id="iHC-iG-by3"/>
<outlet property="delegate" destination="0L2-ND-Twh" id="nAg-yY-JmZ"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="Settings" id="jxD-pO-Xgu"/>
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
<connections>
<outlet property="exportCell" destination="J1T-67-jcC" id="VZX-ue-ZCE"/>
<outlet property="goVersionInfoCell" destination="7To-1u-V41" id="CeX-R9-6Qh"/>
<outlet property="goVersionInfoLabel" destination="ZLF-fc-FG0" id="5si-K0-QJL"/>
<outlet property="versionInfoCell" destination="4T9-BK-cKk" id="QrQ-73-Cpq"/>
<outlet property="versionInfoLabel" destination="64F-sz-1fb" id="O1J-1X-GvV"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="DXL-eC-zr0" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="726" y="-469"/>
</scene>
</scenes>
<resources>