Rename AppImage.accountImage to the less redundant AppImage.account.

This commit is contained in:
Brent Simmons
2025-01-27 22:40:31 -08:00
parent 72131c9b56
commit a7d4c4912d
12 changed files with 21 additions and 21 deletions

View File

@@ -39,23 +39,23 @@ final class AccountsReaderAPIWindowController: NSWindowController {
if let accountType = accountType {
switch accountType {
case .freshRSS:
titleImageView.image = AppImage.accountImage(.freshRSS)
titleImageView.image = AppImage.account(.freshRSS)
titleLabel.stringValue = NSLocalizedString("Sign in to your FreshRSS account.", comment: "FreshRSS")
noAccountTextField.stringValue = NSLocalizedString("Dont have a FreshRSS instance?", comment: "No FreshRSS")
createAccountButton.title = NSLocalizedString("Find out more", comment: "No FreshRSS Button")
apiURLTextField.placeholderString = NSLocalizedString("fresh.rss.net/api/greader.php", comment: "FreshRSS API Helper")
case .inoreader:
titleImageView.image = AppImage.accountImage(.inoreader)
titleImageView.image = AppImage.account(.inoreader)
titleLabel.stringValue = NSLocalizedString("Sign in to your InoReader account.", comment: "InoReader")
gridView.row(at: 2).isHidden = true
noAccountTextField.stringValue = NSLocalizedString("Dont have an InoReader account?", comment: "No InoReader")
case .bazQux:
titleImageView.image = AppImage.accountImage(.bazQux)
titleImageView.image = AppImage.account(.bazQux)
titleLabel.stringValue = NSLocalizedString("Sign in to your BazQux account.", comment: "BazQux")
gridView.row(at: 2).isHidden = true
noAccountTextField.stringValue = NSLocalizedString("Dont have a BazQux account?", comment: "No BazQux")
case .theOldReader:
titleImageView.image = AppImage.accountImage(.theOldReader)
titleImageView.image = AppImage.account(.theOldReader)
titleLabel.stringValue = NSLocalizedString("Sign in to your The Old Reader account.", comment: "The Old Reader")
gridView.row(at: 2).isHidden = true
noAccountTextField.stringValue = NSLocalizedString("Dont have a The Old Reader account?", comment: "No OldReader")

View File

@@ -18,7 +18,7 @@ struct AppImage {
// MARK: - Account
static func accountImage(_ accountType: AccountType) -> RSImage? {
static func account(_ accountType: AccountType) -> RSImage? {
switch accountType {
case .onMyMac:
AppImage.accountLocal

View File

@@ -18,7 +18,7 @@ protocol SmallIconProvider {
extension Account: SmallIconProvider {
var smallIcon: IconImage? {
if let image = AppImage.accountImage(type) {
if let image = AppImage.account(type) {
return IconImage(image)
}
return nil

View File

@@ -57,7 +57,7 @@ final class CloudKitAccountViewController: UITableViewController {
override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
if section == 0 {
let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: "SectionHeader") as! ImageHeaderView
headerView.imageView.image = AppImage.accountImage(.cloudKit)
headerView.imageView.image = AppImage.account(.cloudKit)
return headerView
} else {
return super.tableView(tableView, viewForHeaderInSection: section)

View File

@@ -59,7 +59,7 @@ final class FeedbinAccountViewController: UITableViewController {
override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
if section == 0 {
let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: "SectionHeader") as! ImageHeaderView
headerView.imageView.image = AppImage.accountImage(.feedbin)
headerView.imageView.image = AppImage.account(.feedbin)
return headerView
} else {
return super.tableView(tableView, viewForHeaderInSection: section)

View File

@@ -46,7 +46,7 @@ final class LocalAccountViewController: UITableViewController {
override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
if section == 0 {
let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: "SectionHeader") as! ImageHeaderView
headerView.imageView.image = AppImage.accountImage(.onMyMac)
headerView.imageView.image = AppImage.account(.onMyMac)
return headerView
} else {
return super.tableView(tableView, viewForHeaderInSection: section)

View File

@@ -58,7 +58,7 @@ final class NewsBlurAccountViewController: UITableViewController {
override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
if section == 0 {
let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: "SectionHeader") as! ImageHeaderView
headerView.imageView.image = AppImage.accountImage(.newsBlur)
headerView.imageView.image = AppImage.account(.newsBlur)
return headerView
} else {
return super.tableView(tableView, viewForHeaderInSection: section)

View File

@@ -210,13 +210,13 @@ final class ReaderAPIAccountViewController: UITableViewController {
if let accountType = accountType {
switch accountType {
case .bazQux:
return AppImage.accountImage(.bazQux)
return AppImage.account(.bazQux)
case .inoreader:
return AppImage.accountImage(.inoreader)
return AppImage.account(.inoreader)
case .theOldReader:
return AppImage.accountImage(.theOldReader)
return AppImage.account(.theOldReader)
case .freshRSS:
return AppImage.accountImage(.freshRSS)
return AppImage.account(.freshRSS)
default:
return nil
}

View File

@@ -169,7 +169,7 @@ extension AccountInspectorViewController {
if section == 0 {
let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: "SectionHeader") as! ImageHeaderView
headerView.imageView.image = AppImage.accountImage(account.type)
headerView.imageView.image = AppImage.account(account.type)
return headerView
} else {
return super.tableView(tableView, viewForHeaderInSection: section)

View File

@@ -127,17 +127,17 @@ final class AddAccountViewController: UITableViewController, AddAccountDismissDe
switch indexPath.section {
case AddAccountSections.local.rawValue:
cell.comboNameLabel?.text = AddAccountSections.local.sectionContent[indexPath.row].localizedAccountName()
cell.comboImage?.image = AppImage.accountImage(.onMyMac)
cell.comboImage?.image = AppImage.account(.onMyMac)
case AddAccountSections.icloud.rawValue:
cell.comboNameLabel?.text = AddAccountSections.icloud.sectionContent[indexPath.row].localizedAccountName()
cell.comboImage?.image = AppImage.accountImage(AddAccountSections.icloud.sectionContent[indexPath.row])
cell.comboImage?.image = AppImage.account(AddAccountSections.icloud.sectionContent[indexPath.row])
if AppDefaults.isDeveloperBuild || AccountManager.shared.accounts.contains(where: { $0.type == .cloudKit }) {
cell.isUserInteractionEnabled = false
cell.comboNameLabel?.isEnabled = false
}
case AddAccountSections.web.rawValue:
cell.comboNameLabel?.text = AddAccountSections.web.sectionContent[indexPath.row].localizedAccountName()
cell.comboImage?.image = AppImage.accountImage(AddAccountSections.web.sectionContent[indexPath.row])
cell.comboImage?.image = AppImage.account(AddAccountSections.web.sectionContent[indexPath.row])
let type = AddAccountSections.web.sectionContent[indexPath.row]
if (type == .feedly || type == .inoreader) && AppDefaults.isDeveloperBuild {
cell.isUserInteractionEnabled = false
@@ -145,7 +145,7 @@ final class AddAccountViewController: UITableViewController, AddAccountDismissDe
}
case AddAccountSections.selfhosted.rawValue:
cell.comboNameLabel?.text = AddAccountSections.selfhosted.sectionContent[indexPath.row].localizedAccountName()
cell.comboImage?.image = AppImage.accountImage(AddAccountSections.selfhosted.sectionContent[indexPath.row])
cell.comboImage?.image = AppImage.account(AddAccountSections.selfhosted.sectionContent[indexPath.row])
default:
return cell

View File

@@ -121,7 +121,7 @@ final class SettingsViewController: UITableViewController {
let acctCell = tableView.dequeueReusableCell(withIdentifier: "SettingsComboTableViewCell", for: indexPath) as! SettingsComboTableViewCell
acctCell.applyThemeProperties()
let account = sortedAccounts[indexPath.row]
acctCell.comboImage?.image = AppImage.accountImage(account.type)
acctCell.comboImage?.image = AppImage.account(account.type)
acctCell.comboNameLabel?.text = account.nameForDisplay
cell = acctCell
}

View File

@@ -46,7 +46,7 @@ final class ShareFolderPickerController: UITableViewController {
}()
if let account = container as? ExtensionAccount {
cell.icon.image = AppImage.accountImage(account.type)
cell.icon.image = AppImage.account(account.type)
} else {
cell.icon.image = AppAssets.folderImage.image
}