mirror of
https://github.com/exituser/Pearcleaner.git
synced 2026-09-17 09:38:51 +00:00
61 lines
2.2 KiB
Swift
61 lines
2.2 KiB
Swift
//
|
|
// Update.swift
|
|
// Pearcleaner
|
|
//
|
|
// Created by Alin Lupascu on 11/5/23.
|
|
//
|
|
|
|
|
|
import SwiftUI
|
|
import Foundation
|
|
import AlinFoundation
|
|
|
|
struct UpdateSettingsTab: View {
|
|
@EnvironmentObject var appState: AppState
|
|
@EnvironmentObject var themeManager: ThemeManager
|
|
@EnvironmentObject var updater: Updater
|
|
@AppStorage("settings.general.glass") private var glass: Bool = false
|
|
|
|
var body: some View {
|
|
VStack(spacing: 20) {
|
|
|
|
// === Frequency ============================================================================================
|
|
PearGroupBox(header: { Text("Update Frequency").font(.title2) }, content: {
|
|
FrequencyView(updater: updater)
|
|
})
|
|
|
|
// === Release Notes ========================================================================================
|
|
PearGroupBox(header: { Text("Release Notes").font(.title2) }, content: {
|
|
ReleasesView(updater: updater)
|
|
.frame(height: 380)
|
|
.frame(maxWidth: .infinity)
|
|
})
|
|
|
|
// === Buttons ==============================================================================================
|
|
|
|
HStack(alignment: .center, spacing: 20) {
|
|
|
|
Button {
|
|
updater.checkForUpdatesForce(showSheet: false)
|
|
} label: { EmptyView() }
|
|
.buttonStyle(SimpleButtonStyle(icon: "arrow.uturn.left.circle", label: String(localized: "Refresh"), help: String(localized: "Refresh updater")))
|
|
|
|
|
|
Button {
|
|
updater.resetAnnouncementAlert()
|
|
} label: { EmptyView() }
|
|
.buttonStyle(SimpleButtonStyle(icon: "star", label: String(localized: "Announcement"), help: String(localized: "Show announcements badge again")))
|
|
|
|
|
|
Button {
|
|
NSWorkspace.shared.open(URL(string: "https://github.com/alienator88/Pearcleaner/releases")!)
|
|
} label: { EmptyView() }
|
|
.buttonStyle(SimpleButtonStyle(icon: "link", label: String(localized: "Releases"), help: String(localized: "View releases on GitHub")))
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|