mirror of https://github.com/buresdv/Cork
~ More migration to `@Defaults`
This commit is contained in:
parent
296daa4756
commit
b13ce91b52
|
|
@ -10,6 +10,7 @@ import DavidFoundation
|
|||
import Foundation
|
||||
import SwiftUI
|
||||
import CorkShared
|
||||
import Defaults
|
||||
|
||||
@Observable
|
||||
class AppDelegate: NSObject, NSApplicationDelegate
|
||||
|
|
|
|||
|
|
@ -7,7 +7,4 @@
|
|||
|
||||
import Foundation
|
||||
|
||||
enum PackageSortingOptions: String, Codable, CaseIterable
|
||||
{
|
||||
case alphabetically, byInstallDate, bySize
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48782,6 +48782,7 @@
|
|||
}
|
||||
},
|
||||
"settings.general.sort-packages.alphabetically" : {
|
||||
"extractionState" : "stale",
|
||||
"localizations" : {
|
||||
"cs" : {
|
||||
"stringUnit" : {
|
||||
|
|
@ -48870,6 +48871,7 @@
|
|||
}
|
||||
},
|
||||
"settings.general.sort-packages.install-date" : {
|
||||
"extractionState" : "stale",
|
||||
"localizations" : {
|
||||
"cs" : {
|
||||
"stringUnit" : {
|
||||
|
|
@ -48958,6 +48960,7 @@
|
|||
}
|
||||
},
|
||||
"settings.general.sort-packages.size" : {
|
||||
"extractionState" : "stale",
|
||||
"localizations" : {
|
||||
"cs" : {
|
||||
"stringUnit" : {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import CorkNotifications
|
|||
import CorkShared
|
||||
import SwiftUI
|
||||
import ButtonKit
|
||||
import Defaults
|
||||
|
||||
struct AddFormulaView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import SwiftUI
|
||||
import CorkShared
|
||||
import Defaults
|
||||
|
||||
struct InstallationInitialView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
import CorkNotifications
|
||||
import CorkShared
|
||||
import SwiftUI
|
||||
import Defaults
|
||||
|
||||
struct InstallationFinishedSuccessfullyView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -39,14 +39,11 @@ struct GeneralPane: View
|
|||
{
|
||||
Form
|
||||
{
|
||||
Picker(selection: $sortPackagesBy)
|
||||
{
|
||||
Text("settings.general.sort-packages.alphabetically")
|
||||
.tag(PackageSortingOptions.alphabetically)
|
||||
Text("settings.general.sort-packages.install-date")
|
||||
.tag(PackageSortingOptions.byInstallDate)
|
||||
Text("settings.general.sort-packages.size")
|
||||
.tag(PackageSortingOptions.bySize)
|
||||
Picker(selection: $sortPackagesBy) {
|
||||
ForEach(PackageSortingOptions.allCases)
|
||||
{ packageSortingOption in
|
||||
Text(packageSortingOption.description)
|
||||
}
|
||||
} label: {
|
||||
Text("settings.general.sort-packages")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,9 +5,10 @@
|
|||
// Created by David Bureš on 17.10.2023.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkShared
|
||||
import CorkNotifications
|
||||
import CorkShared
|
||||
import Defaults
|
||||
import SwiftUI
|
||||
|
||||
struct ErroredOutStageView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,8 +5,9 @@
|
|||
// Created by David Bureš on 17.10.2023.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkNotifications
|
||||
import Defaults
|
||||
import SwiftUI
|
||||
|
||||
struct FinishedStageView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,9 +5,10 @@
|
|||
// Created by David Bureš on 17.10.2023.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkShared
|
||||
import CorkNotifications
|
||||
import CorkShared
|
||||
import Defaults
|
||||
import SwiftUI
|
||||
|
||||
struct NoUpdatesAvailableStageView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,7 +8,22 @@
|
|||
import Foundation
|
||||
import Defaults
|
||||
|
||||
public enum PackageSortingOptions: String, Codable, CaseIterable, Defaults.Serializable
|
||||
public enum PackageSortingOptions: Codable, CaseIterable, Identifiable, Defaults.Serializable
|
||||
{
|
||||
case alphabetically, byInstallDate, bySize
|
||||
|
||||
public var id: Self { self }
|
||||
|
||||
public var description: LocalizedStringResource
|
||||
{
|
||||
switch self
|
||||
{
|
||||
case .alphabetically:
|
||||
return "settings.general.sort-packages.alphabetically"
|
||||
case .byInstallDate:
|
||||
return "settings.general.sort-packages.install-date"
|
||||
case .bySize:
|
||||
return "settings.general.sort-packages.size"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue