Move Credits inside Version

This commit is contained in:
Davide De Rosa 2018-10-29 20:41:25 +01:00
parent 22ad02fc6a
commit fec2f02df5
6 changed files with 37 additions and 32 deletions

View File

@ -23,7 +23,6 @@ internal enum StoryboardSegue {
internal enum Organizer: String, SegueType {
case aboutSegueIdentifier = "AboutSegueIdentifier"
case addProviderSegueIdentifier = "AddProviderSegueIdentifier"
case creditsSegueIdentifier = "CreditsSegueIdentifier"
case disclaimerSegueIdentifier = "DisclaimerSegueIdentifier"
case importHostSegueIdentifier = "ImportHostSegueIdentifier"
case selectProfileSegueIdentifier = "SelectProfileSegueIdentifier"

View File

@ -39,7 +39,7 @@ class AboutViewController: UITableViewController, TableModelHost {
model.setHeader(L10n.About.Sections.Source.header, for: .source)
model.setHeader(L10n.About.Sections.Share.header, for: .share)
model.setHeader(L10n.About.Sections.Feedback.header, for: .feedback)
model.set([.version, .credits, .disclaimer, .website], in: .info)
model.set([.version, .disclaimer, .website], in: .info)
model.set([.sourcePassepartout, .sourceTunnelKit], in: .source)
model.set([.shareTwitter, .shareGeneric], in: .share)
model.set([.joinCommunity, .writeReview], in: .feedback)
@ -69,10 +69,6 @@ class AboutViewController: UITableViewController, TableModelHost {
perform(segue: StoryboardSegue.Organizer.versionSegueIdentifier)
}
private func showCredits() {
perform(segue: StoryboardSegue.Organizer.creditsSegueIdentifier)
}
private func showDisclaimer() {
perform(segue: StoryboardSegue.Organizer.disclaimerSegueIdentifier)
}
@ -118,11 +114,6 @@ class AboutViewController: UITableViewController, TableModelHost {
}
switch segueType {
case .creditsSegueIdentifier:
var notices = AppConstants.Notices.all
notices.insert(L10n.Credits.Labels.thirdParties, at: 0)
vc.text = notices.joined(separator: "\n\n")
case .disclaimerSegueIdentifier:
vc.text = L10n.Disclaimer.Labels.text
@ -148,8 +139,6 @@ extension AboutViewController {
enum RowType: Int {
case version
case credits
case disclaimer
case website
@ -191,11 +180,6 @@ extension AboutViewController {
cell.rightText = Utils.versionString()
return cell
case .credits:
let cell = Cells.setting.dequeue(from: tableView, for: indexPath)
cell.leftText = L10n.Credits.title
return cell
case .disclaimer:
let cell = Cells.setting.dequeue(from: tableView, for: indexPath)
cell.leftText = L10n.Disclaimer.title
@ -243,9 +227,6 @@ extension AboutViewController {
case .version:
showVersion()
case .credits:
showCredits()
case .disclaimer:
showDisclaimer()

View File

@ -32,12 +32,12 @@ class VersionViewController: UIViewController {
@IBOutlet private weak var labelVersion: UILabel?
@IBOutlet private weak var labelCopyright: UILabel?
@IBOutlet private weak var labelIntro: UILabel?
@IBOutlet private weak var buttonChangelog: UIButton?
@IBOutlet private weak var buttonCredits: UIButton?
override func awakeFromNib() {
super.awakeFromNib()
@ -49,18 +49,29 @@ class VersionViewController: UIViewController {
labelTitle?.text = GroupConstants.App.name
labelVersion?.text = Utils.versionString()
labelCopyright?.text = GroupConstants.App.name
labelIntro?.text = L10n.Version.Labels.intro
buttonChangelog?.setTitle(L10n.Version.Buttons.changelog, for: .normal)
buttonCredits?.setTitle(L10n.Version.Buttons.credits, for: .normal)
scrollView?.applyPrimaryBackground(Theme.current)
for label in [labelTitle, labelVersion, labelCopyright, labelIntro] {
for label in [labelTitle, labelVersion, labelIntro] {
label?.applyLight(Theme.current)
}
buttonChangelog?.apply(Theme.current)
buttonCredits?.apply(Theme.current)
}
@IBAction private func visitChangelog() {
UIApplication.shared.open(AppConstants.URLs.changelog, options: [:], completionHandler: nil)
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
guard let vc = segue.destination as? LabelViewController else {
return
}
vc.title = L10n.Credits.title
var notices = AppConstants.Notices.all
notices.insert(L10n.Credits.Labels.thirdParties, at: 0)
vc.text = notices.joined(separator: "\n\n")
}
}

View File

@ -328,10 +328,10 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Kan-Ro-DbI">
<rect key="frame" x="0.0" y="0.0" width="375" height="448"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="491"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="RP1-au-v0h">
<rect key="frame" x="28" y="40" width="319" height="368"/>
<rect key="frame" x="28" y="40" width="319" height="411"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="logo" translatesAutoresizingMaskIntoConstraints="NO" id="eRj-AM-Edq">
<rect key="frame" x="59.5" y="0.0" width="200" height="200"/>
@ -362,6 +362,14 @@
<action selector="visitChangelog" destination="PMT-gj-ARE" eventType="touchUpInside" id="hSv-6o-eXI"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rtK-wa-fgh">
<rect key="frame" x="0.0" y="378" width="319" height="33"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<state key="normal" title="&lt;CRD&gt;"/>
<connections>
<segue destination="2d7-Ad-AZr" kind="show" id="SQ0-O9-E5E"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="wV2-Nx-RuF" secondAttribute="trailing" id="1jj-cq-2Ja"/>
@ -370,14 +378,17 @@
<constraint firstItem="Zek-qD-saW" firstAttribute="leading" secondItem="RP1-au-v0h" secondAttribute="leading" id="4r5-es-LKj"/>
<constraint firstItem="tOJ-Gb-6TL" firstAttribute="top" secondItem="Zek-qD-saW" secondAttribute="bottom" constant="5" id="5EV-6h-af6"/>
<constraint firstItem="F6g-5X-yGY" firstAttribute="leading" secondItem="RP1-au-v0h" secondAttribute="leading" id="Bbh-jl-eyk"/>
<constraint firstItem="rtK-wa-fgh" firstAttribute="top" secondItem="wV2-Nx-RuF" secondAttribute="bottom" constant="10" id="ChX-qg-yan"/>
<constraint firstItem="Zek-qD-saW" firstAttribute="top" secondItem="eRj-AM-Edq" secondAttribute="bottom" constant="20" id="E5v-Gd-4FH"/>
<constraint firstItem="wV2-Nx-RuF" firstAttribute="leading" secondItem="RP1-au-v0h" secondAttribute="leading" id="Iop-zX-3fL"/>
<constraint firstItem="F6g-5X-yGY" firstAttribute="top" secondItem="tOJ-Gb-6TL" secondAttribute="bottom" constant="20" id="Vla-uy-lL8"/>
<constraint firstAttribute="trailing" secondItem="Zek-qD-saW" secondAttribute="trailing" id="WL1-SB-5gf"/>
<constraint firstAttribute="bottom" secondItem="rtK-wa-fgh" secondAttribute="bottom" id="XDo-fJ-IOo"/>
<constraint firstAttribute="trailing" secondItem="tOJ-Gb-6TL" secondAttribute="trailing" id="a5o-c7-BD5"/>
<constraint firstAttribute="trailing" secondItem="rtK-wa-fgh" secondAttribute="trailing" id="dBQ-XF-2mE"/>
<constraint firstItem="tOJ-Gb-6TL" firstAttribute="leading" secondItem="RP1-au-v0h" secondAttribute="leading" id="grT-YM-rGi"/>
<constraint firstAttribute="bottom" secondItem="wV2-Nx-RuF" secondAttribute="bottom" id="m4p-a0-sqe"/>
<constraint firstItem="eRj-AM-Edq" firstAttribute="top" secondItem="RP1-au-v0h" secondAttribute="top" id="q35-KT-uTl"/>
<constraint firstItem="rtK-wa-fgh" firstAttribute="leading" secondItem="RP1-au-v0h" secondAttribute="leading" id="weH-qk-nTh"/>
<constraint firstItem="wV2-Nx-RuF" firstAttribute="top" secondItem="F6g-5X-yGY" secondAttribute="bottom" constant="20" id="y5I-Du-MiY"/>
</constraints>
</view>
@ -411,6 +422,7 @@
</view>
<connections>
<outlet property="buttonChangelog" destination="wV2-Nx-RuF" id="E0X-ek-Ii2"/>
<outlet property="buttonCredits" destination="rtK-wa-fgh" id="56A-mE-YHa"/>
<outlet property="labelIntro" destination="F6g-5X-yGY" id="QSg-VO-Wf4"/>
<outlet property="labelTitle" destination="Zek-qD-saW" id="TL8-Vb-B58"/>
<outlet property="labelVersion" destination="tOJ-Gb-6TL" id="O7w-Ne-L0R"/>
@ -419,7 +431,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="n7m-Yv-Puo" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-2551.1999999999998" y="-2224.1379310344828"/>
<point key="canvasLocation" x="-2551" y="-2246"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="bMd-7b-j9C">
@ -484,7 +496,6 @@
</barButtonItem>
</navigationItem>
<connections>
<segue destination="2d7-Ad-AZr" kind="show" identifier="CreditsSegueIdentifier" id="tGv-dr-20P"/>
<segue destination="PMT-gj-ARE" kind="show" identifier="VersionSegueIdentifier" id="uYt-4N-PPL"/>
<segue destination="2d7-Ad-AZr" kind="show" identifier="DisclaimerSegueIdentifier" id="HW6-RJ-VFY"/>
</connections>
@ -566,7 +577,7 @@
<image name="logo" width="200" height="200"/>
</resources>
<inferredMetricsTieBreakers>
<segue reference="HW6-RJ-VFY"/>
<segue reference="SQ0-O9-E5E"/>
<segue reference="kwN-PZ-Zg5"/>
</inferredMetricsTieBreakers>
</document>

View File

@ -200,6 +200,7 @@
"version.labels.intro" = "Passepartout and TunnelKit are written and maintained by Davide De Rosa (keeshux).\n\nTunnelKit is a native OpenVPN client originally forked from PIATunnel by Private Internet Access.\n\nSource code for Passepartout and TunnelKit is publicly available on GitHub under the GPLv3.";
"version.buttons.changelog" = "CHANGELOG";
"version.buttons.credits" = "CREDITS";
"credits.title" = "Credits";
"credits.labels.third_parties" = "Passepartout is a non-official client and is in no way affiliated with OpenVPN Inc.\n\nThe logo is taken from the awesome Circle Icons set by Nick Roach.";

View File

@ -614,6 +614,8 @@ internal enum L10n {
internal enum Buttons {
/// CHANGELOG
internal static let changelog = L10n.tr("Localizable", "version.buttons.changelog")
/// CREDITS
internal static let credits = L10n.tr("Localizable", "version.buttons.credits")
}
internal enum Labels {
/// Passepartout and TunnelKit are written and maintained by Davide De Rosa (keeshux).\n\nTunnelKit is a native OpenVPN client originally forked from PIATunnel by Private Internet Access.\n\nSource code for Passepartout and TunnelKit is publicly available on GitHub under the GPLv3.