diff --git a/Cork/CorkApp.swift b/Cork/CorkApp.swift index 39043c0c..29c68dff 100644 --- a/Cork/CorkApp.swift +++ b/Cork/CorkApp.swift @@ -92,7 +92,8 @@ struct CorkApp: App .environment(outdatedPackagesTracker) .environment(topPackagesTracker) .modelContainer(for: [ - SavedTaggedPackage.self + SavedTaggedPackage.self, + ExcludedAdoptableApp.self ]) .task { diff --git a/Cork/Localizable.xcstrings b/Cork/Localizable.xcstrings index cc3ff645..7565ef7a 100644 --- a/Cork/Localizable.xcstrings +++ b/Cork/Localizable.xcstrings @@ -93,9 +93,6 @@ } } } - }, - "(%@)" : { - }, "%@" : { "localizations" : { @@ -15591,6 +15588,9 @@ } } } + }, + "adoptable-packages.excluded-label" : { + }, "adoptable-packages.excluded.label" : { "comment" : "A label for the section that lists apps that are excluded from being adopted.", diff --git a/Cork/Views/Reusables/Buttons/Preview Package.swift b/Cork/Views/Reusables/Buttons/Preview Package.swift index a72fe9fa..99a488fd 100644 --- a/Cork/Views/Reusables/Buttons/Preview Package.swift +++ b/Cork/Views/Reusables/Buttons/Preview Package.swift @@ -63,23 +63,3 @@ struct PreviewPackageButtonWithCustomLabel: View .keyboardShortcut("p", modifiers: [.command, .option]) } } - -struct PreviewPackageButtonWithCustomLabel: View -{ - @Environment(\.openWindow) var openWindow: OpenWindowAction - - let label: LocalizedStringKey - - let packageToPreview: MinimalHomebrewPackage - - var body: some View - { - Button - { - openWindow(value: packageToPreview) - } label: { - Text(label) - } - .keyboardShortcut("p", modifiers: [.command, .option]) - } -} diff --git a/Cork/Views/Start Page/Sub-Views/Adoptable Packages Box.swift b/Cork/Views/Start Page/Sub-Views/Adoptable Packages Box.swift index 1f3663c6..0e42785b 100644 --- a/Cork/Views/Start Page/Sub-Views/Adoptable Packages Box.swift +++ b/Cork/Views/Start Page/Sub-Views/Adoptable Packages Box.swift @@ -64,6 +64,11 @@ struct AdoptablePackagesSection: View { adoptablePackagesList } + + DisclosureGroup("adoptable-packages.excluded-label") + { + excludedAdoptablePackagesList + } } } .animation(.bouncy, value: brewPackagesTracker.adoptableApps.isEmpty) @@ -91,9 +96,11 @@ struct AdoptablePackagesSection: View } DisclosureGroup("adoptable-packages.label") - Button(role: .cancel) { adoptablePackagesList + } + Button(role: .cancel) + { isShowingAdoptionWarning = false } label: { Text("action.cancel-and-disable-mass-adoption") @@ -286,7 +293,7 @@ struct AdoptablePackageListItem: View Divider() - // ignoreAdoptableAppButton(appToIgnore: adoptableCask) + ignoreAdoptableAppButton(appToIgnore: adoptableCask) } } diff --git a/Modules/Packages/PackagesModels/Models/Brew Package.swift b/Modules/Packages/PackagesModels/Models/Brew Package.swift index 0f50644b..e571f63b 100644 --- a/Modules/Packages/PackagesModels/Models/Brew Package.swift +++ b/Modules/Packages/PackagesModels/Models/Brew Package.swift @@ -51,8 +51,8 @@ public struct BrewPackage: Identifiable, Equatable, Hashable, Codable, Sendable, public var id: UUID public let name: String - let type: PackageType - var isTagged: Bool = false + public let type: PackageType + public var isTagged: Bool = false public var isPinned: Bool @@ -284,7 +284,7 @@ public struct BrewPackage: Identifiable, Equatable, Hashable, Codable, Sendable, } } - func getSanitizedName() -> String + public func getSanitizedName() -> String { var packageNameWithoutTap: String { /// First, remove the tap name from the package name if it has it diff --git a/Modules/Shared/App Constants.swift b/Modules/Shared/App Constants.swift index a948dc87..ad12dafd 100644 --- a/Modules/Shared/App Constants.swift +++ b/Modules/Shared/App Constants.swift @@ -71,7 +71,7 @@ public struct AppConstants: Sendable do { - let initializedModelContainer = try ModelContainer(for: SavedTaggedPackage.self, configurations: modelConfiguration) + let initializedModelContainer = try ModelContainer(for: SavedTaggedPackage.self, ExcludedAdoptableApp.self, configurations: modelConfiguration) self.modelContainer = initializedModelContainer }