mirror of https://github.com/buresdv/Cork
+ Finished adoptable app exclusion
This commit is contained in:
parent
30f0f07d14
commit
2afda709de
|
|
@ -6635,8 +6635,15 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"action.hide-adoptable-packages-section-if-only-excluded-apps-available.action" : {
|
||||
|
||||
"action.hide-adoptable-packages-section-if-only-excluded-apps-available.confirm" : {
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Hide section"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"action.inspect-error" : {
|
||||
"localizations" : {
|
||||
|
|
@ -15626,7 +15633,8 @@
|
|||
},
|
||||
"adoptable-packages.excluded.label" : {
|
||||
"comment" : "A label for the section that lists apps that are excluded from being adopted.",
|
||||
"isCommentAutoGenerated" : true
|
||||
"isCommentAutoGenerated" : true,
|
||||
"shouldTranslate" : false
|
||||
},
|
||||
"adoptable-packages.label" : {
|
||||
"comment" : "The label for the disclosure group that lists adoptable packages.",
|
||||
|
|
@ -22646,7 +22654,8 @@
|
|||
"value" : "error.data-downloading.couldnt-execute-request.%@"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"shouldTranslate" : false
|
||||
},
|
||||
"error.data-downloading.invalid-response.%lld" : {
|
||||
"localizations" : {
|
||||
|
|
@ -48838,6 +48847,28 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"settings.discoverability.mass-adoption.hide-adoptable-packages-section-if-there-are-only-excluded-apps-available.label" : {
|
||||
"comment" : "A label describing a toggle that controls whether the \"Adoptable Packages\" section is hidden when there are only excluded apps available.",
|
||||
"isCommentAutoGenerated" : true,
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Hide when all adoptable apps are excluded"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"settings.discoverability.mass-adoption.label" : {
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "App adoption:"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"settings.discoverability.mass-adoption.toggle" : {
|
||||
"comment" : "A toggle that allows or disallows mass adoption of packages.",
|
||||
"isCommentAutoGenerated" : true,
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ struct DiscoverabilityPane: View
|
|||
@Default(.discoverabilityDaySpan) var discoverabilityDaySpan: DiscoverabilityDaySpans
|
||||
@Default(.sortTopPackagesBy) var sortTopPackagesBy: TopPackageSorting
|
||||
@Default(.allowMassPackageAdoption) var allowMassPackageAdoption: Bool
|
||||
@Default(.hideAdoptablePackagesSectionIfThereAreOnlyExcludedAppsAvailable) var hideAdoptablePackagesSectionIfThereAreOnlyExcludedAppsAvailable: Bool
|
||||
|
||||
@Environment(AppState.self) var appState: AppState
|
||||
|
||||
|
|
@ -39,17 +40,30 @@ struct DiscoverabilityPane: View
|
|||
}
|
||||
.toggleStyle(.switch)
|
||||
.disabled(appState.isLoadingTopPackages)
|
||||
|
||||
Defaults.Toggle(key: .allowMassPackageAdoption)
|
||||
{
|
||||
Text("settings.discoverability.mass-adoption.toggle")
|
||||
}
|
||||
.disabled(!enableDiscoverability)
|
||||
|
||||
Divider()
|
||||
|
||||
Form
|
||||
{
|
||||
LabeledContent
|
||||
{
|
||||
VStack(alignment: .leading, spacing: 6)
|
||||
{
|
||||
Defaults.Toggle(key: .allowMassPackageAdoption)
|
||||
{
|
||||
Text("settings.discoverability.mass-adoption.toggle")
|
||||
}
|
||||
.disabled(!enableDiscoverability)
|
||||
|
||||
Defaults.Toggle(key: .hideAdoptablePackagesSectionIfThereAreOnlyExcludedAppsAvailable)
|
||||
{
|
||||
Text("settings.discoverability.mass-adoption.hide-adoptable-packages-section-if-there-are-only-excluded-apps-available.label")
|
||||
}
|
||||
}
|
||||
} label: {
|
||||
Text("settings.discoverability.mass-adoption.label")
|
||||
}
|
||||
|
||||
Picker("settings.discoverability.time-span", selection: $discoverabilityDaySpan)
|
||||
{
|
||||
ForEach(DiscoverabilityDaySpans.allCases)
|
||||
|
|
|
|||
|
|
@ -85,11 +85,7 @@ struct AdoptablePackagesSection: View
|
|||
{
|
||||
if allowMassPackageAdoption
|
||||
{
|
||||
if !brewPackagesTracker.adoptableAppsNonExcluded.isEmpty
|
||||
{
|
||||
adoptablePackagesSectionContent
|
||||
}
|
||||
else if !hideAdoptablePackagesSectionIfThereAreOnlyExcludedAppsAvailable
|
||||
if !(hideAdoptablePackagesSectionIfThereAreOnlyExcludedAppsAvailable && brewPackagesTracker.adoptableAppsNonExcluded.isEmpty)
|
||||
{
|
||||
adoptablePackagesSectionContent
|
||||
}
|
||||
|
|
@ -154,18 +150,22 @@ struct AdoptablePackagesSection: View
|
|||
|
||||
Spacer()
|
||||
|
||||
startAdoptionProcessButton
|
||||
|
||||
if adoptablePackagesHeadlineState == .showsExcludedPackagesOnly
|
||||
HStack
|
||||
{
|
||||
hideAdoptablePackagesSectionIfThereAreOnlyIgnoredAppsButton
|
||||
.transition(.asymmetric(
|
||||
insertion: .push(from: .trailing),
|
||||
removal: .push(from: .leading)
|
||||
))
|
||||
startAdoptionProcessButton
|
||||
|
||||
if adoptablePackagesHeadlineState == .showsExcludedPackagesOnly
|
||||
{
|
||||
hideAdoptablePackagesSectionIfThereAreOnlyIgnoredAppsButton
|
||||
.transition(.asymmetric(
|
||||
insertion: .push(from: .trailing),
|
||||
removal: .push(from: .leading)
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.animation(.smooth, value: adoptablePackagesHeadlineState)
|
||||
|
||||
if !brewPackagesTracker.adoptableAppsNonExcluded.isEmpty
|
||||
{
|
||||
DisclosureGroup(isExpanded: $isAdoptablePackagesDisclosureGroupOpened.animation()) {
|
||||
|
|
@ -237,7 +237,7 @@ struct AdoptablePackagesSection: View
|
|||
{
|
||||
hideAdoptablePackagesSectionIfThereAreOnlyExcludedAppsAvailable = true
|
||||
} label: {
|
||||
Text("action.hide-adoptable-packages-section-if-only-excluded-apps-available")
|
||||
Text("action.hide-adoptable-packages-section-if-only-excluded-apps-available.confirm")
|
||||
}
|
||||
.keyboardShortcut(.defaultAction)
|
||||
}
|
||||
|
|
@ -247,7 +247,7 @@ struct AdoptablePackagesSection: View
|
|||
{
|
||||
hideAdoptablePackagesSectionIfThereAreOnlyExcludedAppsAvailable = true
|
||||
} label: {
|
||||
Text("action.hide-adoptable-packages-section-if-only-excluded-apps-available")
|
||||
Text("action.hide-adoptable-packages-section-if-only-excluded-apps-available.confirm")
|
||||
}
|
||||
.keyboardShortcut(.defaultAction)
|
||||
}
|
||||
|
|
@ -565,3 +565,4 @@ struct AdoptablePackageListItem: View
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue