From c8bc2cde2ea9630f3271033f4a78a649d8b84bb7 Mon Sep 17 00:00:00 2001 From: Evan Hahn Date: Wed, 26 Oct 2022 11:55:11 -0500 Subject: [PATCH] Improve name of donation settings view controller This change should have no user impact. `DonationViewController` is now `DonationSettingsViewController`. I think this is a better name on its own, but it'll seem even better after upcoming change. --- Signal.xcodeproj/project.pbxproj | 8 ++++---- .../Upgrade Views/DonationMegaphone.swift | 2 +- .../AppSettings/AppSettingsViewController.swift | 7 +++++-- ...er.swift => DonationSettingsViewController.swift} | 12 ++++++------ .../ConversationViewController+GiftBadges.swift | 5 ++++- 5 files changed, 20 insertions(+), 14 deletions(-) rename Signal/src/ViewControllers/AppSettings/Donations/{DonationViewController.swift => DonationSettingsViewController.swift} (98%) diff --git a/Signal.xcodeproj/project.pbxproj b/Signal.xcodeproj/project.pbxproj index 63c2dbab06..ca8fbda754 100644 --- a/Signal.xcodeproj/project.pbxproj +++ b/Signal.xcodeproj/project.pbxproj @@ -1265,7 +1265,7 @@ F9A042C8289C7500007D08B6 /* GroupManager+GroupUpdateInfoMessages.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9A042C7289C7500007D08B6 /* GroupManager+GroupUpdateInfoMessages.swift */; }; F9A335CA282F0BF700B5F5FA /* BadgeGiftingChooseBadgeViewControllerStateTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9A335C9282F0BF700B5F5FA /* BadgeGiftingChooseBadgeViewControllerStateTest.swift */; }; F9A335CC282F0DEC00B5F5FA /* BadgeGiftingChooseRecipientViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9A335CB282F0DEC00B5F5FA /* BadgeGiftingChooseRecipientViewController.swift */; }; - F9A8ACC7280A175E00AFC6A7 /* DonationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9A8ACC6280A175E00AFC6A7 /* DonationViewController.swift */; }; + F9A8ACC7280A175E00AFC6A7 /* DonationSettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9A8ACC6280A175E00AFC6A7 /* DonationSettingsViewController.swift */; }; F9AE695328F046E40012E9C9 /* OWSFingerprintTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9AE695228F046E40012E9C9 /* OWSFingerprintTest.swift */; }; F9B0DC4F28948656004E07B7 /* schema.sql in Resources */ = {isa = PBXBuildFile; fileRef = F9B0DC3C28948656004E07B7 /* schema.sql */; }; F9B0DC5028948656004E07B7 /* signal-mainnet.der in Resources */ = {isa = PBXBuildFile; fileRef = F9B0DC3E28948656004E07B7 /* signal-mainnet.der */; }; @@ -3604,7 +3604,7 @@ F9A042C7289C7500007D08B6 /* GroupManager+GroupUpdateInfoMessages.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "GroupManager+GroupUpdateInfoMessages.swift"; sourceTree = ""; }; F9A335C9282F0BF700B5F5FA /* BadgeGiftingChooseBadgeViewControllerStateTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeGiftingChooseBadgeViewControllerStateTest.swift; sourceTree = ""; }; F9A335CB282F0DEC00B5F5FA /* BadgeGiftingChooseRecipientViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeGiftingChooseRecipientViewController.swift; sourceTree = ""; }; - F9A8ACC6280A175E00AFC6A7 /* DonationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DonationViewController.swift; sourceTree = ""; }; + F9A8ACC6280A175E00AFC6A7 /* DonationSettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DonationSettingsViewController.swift; sourceTree = ""; }; F9AE695228F046E40012E9C9 /* OWSFingerprintTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OWSFingerprintTest.swift; sourceTree = ""; }; F9B0DC3C28948656004E07B7 /* schema.sql */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = schema.sql; sourceTree = ""; }; F9B0DC3E28948656004E07B7 /* signal-mainnet.der */ = {isa = PBXFileReference; lastKnownFileType = file; path = "signal-mainnet.der"; sourceTree = ""; }; @@ -7170,7 +7170,7 @@ F9F4DE29283FDFDA001909ED /* BadgeGiftingConfirmationViewController.swift */, F9066F0627ECE41B008C9530 /* DonationReceiptsViewController.swift */, F900F2DC27F25AB300431E09 /* DonationReceiptViewController.swift */, - F9A8ACC6280A175E00AFC6A7 /* DonationViewController.swift */, + F9A8ACC6280A175E00AFC6A7 /* DonationSettingsViewController.swift */, ); path = Donations; sourceTree = ""; @@ -10215,7 +10215,7 @@ F924A68228F8706200E368C8 /* DonationReadMoreSheetViewController.swift in Sources */, F9066F0727ECE41B008C9530 /* DonationReceiptsViewController.swift in Sources */, F900F2DD27F25AB400431E09 /* DonationReceiptViewController.swift in Sources */, - F9A8ACC7280A175E00AFC6A7 /* DonationViewController.swift in Sources */, + F9A8ACC7280A175E00AFC6A7 /* DonationSettingsViewController.swift in Sources */, F9DD70B92811AF82000C5960 /* DonationViewsUtil.swift in Sources */, 3428577D26BD8777005A2A96 /* Emoji+Available.swift in Sources */, 3428577726BD8777005A2A96 /* Emoji+Category.swift in Sources */, diff --git a/Signal/src/Experience Upgrades/Upgrade Views/DonationMegaphone.swift b/Signal/src/Experience Upgrades/Upgrade Views/DonationMegaphone.swift index dcd9a07633..70acb2abfa 100644 --- a/Signal/src/Experience Upgrades/Upgrade Views/DonationMegaphone.swift +++ b/Signal/src/Experience Upgrades/Upgrade Views/DonationMegaphone.swift @@ -26,7 +26,7 @@ class DonationMegaphone: MegaphoneView { "DONATE_MEGAPHONE_ACTION", comment: "Action text for donate megaphone" )) { - let vc = OWSNavigationController(rootViewController: DonationViewController()) + let vc = OWSNavigationController(rootViewController: DonationSettingsViewController()) fromViewController.present(vc, animated: true) }, secondary: Button(title: NSLocalizedString( diff --git a/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.swift b/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.swift index 36bba8b220..002f5e61fc 100644 --- a/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.swift +++ b/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.swift @@ -88,7 +88,7 @@ class AppSettingsViewController: OWSTableViewController2 { private var hasExpiredGiftBadge: Bool = false private func updateHasExpiredGiftBadge() { - self.hasExpiredGiftBadge = DonationViewController.shouldShowExpiredGiftBadgeSheetWithSneakyTransaction() + self.hasExpiredGiftBadge = DonationSettingsViewController.shouldShowExpiredGiftBadgeSheetWithSneakyTransaction() } @objc @@ -162,7 +162,10 @@ class AppSettingsViewController: OWSTableViewController2 { accessibilityIdentifier: UIView.accessibilityIdentifier(in: self, name: "donate") ) }, actionBlock: { [weak self] in - self?.navigationController?.pushViewController(DonationViewController(), animated: true) + self?.navigationController?.pushViewController( + DonationSettingsViewController(), + animated: true + ) })) contents.addSection(section1) diff --git a/Signal/src/ViewControllers/AppSettings/Donations/DonationViewController.swift b/Signal/src/ViewControllers/AppSettings/Donations/DonationSettingsViewController.swift similarity index 98% rename from Signal/src/ViewControllers/AppSettings/Donations/DonationViewController.swift rename to Signal/src/ViewControllers/AppSettings/Donations/DonationSettingsViewController.swift index fb07d70155..ce7ae087be 100644 --- a/Signal/src/ViewControllers/AppSettings/Donations/DonationViewController.swift +++ b/Signal/src/ViewControllers/AppSettings/Donations/DonationSettingsViewController.swift @@ -9,7 +9,7 @@ import SignalMessaging import SignalUI import UIKit -class DonationViewController: OWSTableViewController2 { +class DonationSettingsViewController: OWSTableViewController2 { private enum State { case initializing case loading @@ -36,7 +36,7 @@ class DonationViewController: OWSTableViewController2 { private var state: State = .initializing { didSet { - Logger.info("[Donations] DonationViewController state changed to \(state.debugDescription)") + Logger.info("[Donations] DonationSettingsViewController state changed to \(state.debugDescription)") updateTableContents() } } @@ -510,7 +510,7 @@ class DonationViewController: OWSTableViewController2 { // MARK: - Badge Expiration Delegate -extension DonationViewController: BadgeExpirationSheetDelegate { +extension DonationSettingsViewController: BadgeExpirationSheetDelegate { func badgeExpirationSheetActionTapped(_ action: BadgeExpirationSheetAction) { switch action { case .dismiss: @@ -525,7 +525,7 @@ extension DonationViewController: BadgeExpirationSheetDelegate { // MARK: - Badge management delegate -extension DonationViewController: BadgeConfigurationDelegate { +extension DonationSettingsViewController: BadgeConfigurationDelegate { func badgeConfiguration(_ vc: BadgeConfigurationViewController, didCompleteWithBadgeSetting setting: BadgeConfiguration) { if !self.reachabilityManager.isReachable { OWSActionSheets.showErrorAlert( @@ -597,7 +597,7 @@ extension DonationViewController: BadgeConfigurationDelegate { // MARK: - Donation hero delegate -extension DonationViewController: DonationHeroViewDelegate { +extension DonationSettingsViewController: DonationHeroViewDelegate { func present(readMoreSheet: DonationReadMoreSheetViewController) { present(readMoreSheet, animated: true) } @@ -605,7 +605,7 @@ extension DonationViewController: DonationHeroViewDelegate { // MARK: - Badge can't be added -extension DonationViewController: UITextViewDelegate { +extension DonationSettingsViewController: UITextViewDelegate { func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool { if textView == statusLabel { let currentSubscription: Subscription? diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController+GiftBadges.swift b/Signal/src/ViewControllers/ConversationView/ConversationViewController+GiftBadges.swift index 6817c97a3b..4598942394 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController+GiftBadges.swift +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController+GiftBadges.swift @@ -140,7 +140,10 @@ extension ConversationViewController: BadgeExpirationSheetDelegate { break case .openSubscriptionsView: let appSettings = AppSettingsViewController.inModalNavigationController() - appSettings.viewControllers += [DonationViewController(), SubscriptionViewController()] + appSettings.viewControllers += [ + DonationSettingsViewController(), + SubscriptionViewController() + ] self.presentFormSheet(appSettings, animated: true, completion: nil) case .openBoostView: owsFailDebug("Not supported")