Skip to content

Commit

Permalink
feat: add acknowledgements
Browse files Browse the repository at this point in the history
  • Loading branch information
okwasniewski committed Sep 7, 2024
1 parent 7b710d7 commit f8732c1
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:

jobs:
build:
runs-on: macos-13
runs-on: macos-14

steps:
- name: Checkout Repository
Expand Down
21 changes: 21 additions & 0 deletions MiniSim.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
76AC9AF62A0EA82C00864A8B /* CustomCommands.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76AC9AF52A0EA82C00864A8B /* CustomCommands.swift */; };
76AC9AF92A0EB50800864A8B /* SymbolPicker in Frameworks */ = {isa = PBXBuildFile; productRef = 76AC9AF82A0EB50800864A8B /* SymbolPicker */; };
76B70F7E2B0D361A009D87A4 /* UserDefaultsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76B70F7D2B0D361A009D87A4 /* UserDefaultsTests.swift */; };
76BF0AD92C8CB3E6003BE568 /* AcknowList in Frameworks */ = {isa = PBXBuildFile; productRef = 76BF0AD82C8CB3E6003BE568 /* AcknowList */; };
76BF0ADB2C8CB4CD003BE568 /* Package.resolved in Resources */ = {isa = PBXBuildFile; fileRef = 76BF0ADA2C8CB4CD003BE568 /* Package.resolved */; };
76C1396A2C849A3F006CD80C /* MenuIcons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76C139692C849A3F006CD80C /* MenuIcons.swift */; };
76E4451229D4391000039025 /* Onboarding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76E4451129D4391000039025 /* Onboarding.swift */; };
76E4451429D4403F00039025 /* NSNotificationName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76E4451329D4403F00039025 /* NSNotificationName.swift */; };
Expand Down Expand Up @@ -167,6 +169,7 @@
76AC9AF52A0EA82C00864A8B /* CustomCommands.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomCommands.swift; sourceTree = "<group>"; };
76B70F742B0D359D009D87A4 /* MiniSimTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MiniSimTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
76B70F7D2B0D361A009D87A4 /* UserDefaultsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDefaultsTests.swift; sourceTree = "<group>"; };
76BF0ADA2C8CB4CD003BE568 /* Package.resolved */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Package.resolved; path = MiniSim.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved; sourceTree = SOURCE_ROOT; };
76C139692C849A3F006CD80C /* MenuIcons.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MenuIcons.swift; sourceTree = "<group>"; };
76E4451129D4391000039025 /* Onboarding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Onboarding.swift; sourceTree = "<group>"; };
76E4451329D4403F00039025 /* NSNotificationName.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSNotificationName.swift; sourceTree = "<group>"; };
Expand All @@ -187,6 +190,7 @@
buildActionMask = 2147483647;
files = (
765077C62C46F04A00C7B5F3 /* Settings in Frameworks */,
76BF0AD92C8CB3E6003BE568 /* AcknowList in Frameworks */,
768F8EC829954C8A00DFBCDB /* Sparkle in Frameworks */,
76F04A14298A62CF00BF9CA3 /* ShellOut in Frameworks */,
76AC9AF92A0EB50800864A8B /* SymbolPicker in Frameworks */,
Expand Down Expand Up @@ -356,6 +360,7 @@
7645D5002982E6FA00019227 /* main.swift */,
766BD2372981628C0042261B /* Assets.xcassets */,
766BD23C2981628C0042261B /* MiniSim.entitlements */,
76BF0ADA2C8CB4CD003BE568 /* Package.resolved */,
766BD2392981628C0042261B /* Preview Content */,
);
path = MiniSim;
Expand Down Expand Up @@ -452,6 +457,7 @@
76AC9AF82A0EB50800864A8B /* SymbolPicker */,
763EEB122A26896B008428F1 /* CodeEditor */,
765077C52C46F04A00C7B5F3 /* Settings */,
76BF0AD82C8CB3E6003BE568 /* AcknowList */,
);
productName = MiniSim;
productReference = 766BD2302981628A0042261B /* MiniSim.app */;
Expand Down Expand Up @@ -513,6 +519,7 @@
763EEB112A26896B008428F1 /* XCRemoteSwiftPackageReference "CodeEditor" */,
4A7892862AF1A767004D3FC8 /* XCRemoteSwiftPackageReference "SwiftLint" */,
76A5C3B72C46E4C40064118A /* XCRemoteSwiftPackageReference "Settings" */,
76BF0AD72C8CB3E6003BE568 /* XCRemoteSwiftPackageReference "AcknowList" */,
);
productRefGroup = 766BD2312981628A0042261B /* Products */;
projectDirPath = "";
Expand All @@ -530,6 +537,7 @@
buildActionMask = 2147483647;
files = (
766BD23B2981628C0042261B /* Preview Assets.xcassets in Resources */,
76BF0ADB2C8CB4CD003BE568 /* Package.resolved in Resources */,
766BD2382981628C0042261B /* Assets.xcassets in Resources */,
7610992D2A3F95850067885A /* MiniSim.sdef in Resources */,
765C44C82A2A6C9600FCC159 /* MainMenu.xib in Resources */,
Expand Down Expand Up @@ -999,6 +1007,14 @@
minimumVersion = 1.0.0;
};
};
76BF0AD72C8CB3E6003BE568 /* XCRemoteSwiftPackageReference "AcknowList" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/vtourraine/AcknowList";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 3.2.0;
};
};
76F04A12298A62CF00BF9CA3 /* XCRemoteSwiftPackageReference "ShellOut" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/JohnSundell/ShellOut.git";
Expand Down Expand Up @@ -1050,6 +1066,11 @@
package = 4A7892862AF1A767004D3FC8 /* XCRemoteSwiftPackageReference "SwiftLint" */;
productName = "plugin:SwiftLintPlugin";
};
76BF0AD82C8CB3E6003BE568 /* AcknowList */ = {
isa = XCSwiftPackageProductDependency;
package = 76BF0AD72C8CB3E6003BE568 /* XCRemoteSwiftPackageReference "AcknowList" */;
productName = AcknowList;
};
76F04A13298A62CF00BF9CA3 /* ShellOut */ = {
isa = XCSwiftPackageProductDependency;
package = 76F04A12298A62CF00BF9CA3 /* XCRemoteSwiftPackageReference "ShellOut" */;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
{
"originHash" : "cd658c4c33f28ee5c23e75fe75f65774af59946eb7d0c9743291b5f38cf4419f",
"pins" : [
{
"identity" : "acknowlist",
"kind" : "remoteSourceControl",
"location" : "https://github.com/vtourraine/AcknowList",
"state" : {
"revision" : "125ff1915a639bf7d97471a4d5ae16765d0c50f2",
"version" : "3.2.0"
}
},
{
"identity" : "codeeditor",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ZeeZide/CodeEditor.git",
"state" : {
"revision" : "180bde07b44dea839b32873bd8586ba146fa9106",
"version" : "1.2.2"
"revision" : "f5c076b94f4ceb05abff88ba91d75a8d57143f0c",
"version" : "1.2.6"
}
},
{
Expand All @@ -23,17 +33,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/krzyzanowskim/CryptoSwift.git",
"state" : {
"revision" : "db51c407d3be4a051484a141bf0bff36c43d3b1e",
"version" : "1.8.0"
"revision" : "678d442c6f7828def400a70ae15968aef67ef52d",
"version" : "1.8.3"
}
},
{
"identity" : "highlightr",
"kind" : "remoteSourceControl",
"location" : "https://github.com/raspu/Highlightr",
"location" : "https://github.com/helje5/Highlightr",
"state" : {
"revision" : "93199b9e434f04bda956a613af8f571933f9f037",
"version" : "2.1.2"
"revision" : "bd0358056ff1f12ea83833a9fc1b3b5a396a9da0",
"version" : "3.0.2"
}
},
{
Expand All @@ -42,7 +52,7 @@
"location" : "https://github.com/sindresorhus/KeyboardShortcuts",
"state" : {
"branch" : "main",
"revision" : "d7b349f6822e24228141e560aa48a32dca23b22c"
"revision" : "e6b60117ec266e1e5d059f7f34815144f9762b36"
}
},
{
Expand All @@ -51,7 +61,7 @@
"location" : "https://github.com/sindresorhus/LaunchAtLogin",
"state" : {
"branch" : "main",
"revision" : "7ad6331f9c38953eb1ce8737758e18f7607e984a"
"revision" : "9a894d799269cb591037f9f9cb0961510d4dca81"
}
},
{
Expand All @@ -77,44 +87,44 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/jpsim/SourceKitten.git",
"state" : {
"revision" : "b6dc09ee51dfb0c66e042d2328c017483a1a5d56",
"version" : "0.34.1"
"revision" : "fd4df99170f5e9d7cf9aa8312aa8506e0e7a44e7",
"version" : "0.35.0"
}
},
{
"identity" : "sparkle",
"kind" : "remoteSourceControl",
"location" : "https://github.com/sparkle-project/Sparkle",
"state" : {
"revision" : "9d85a02fe7916caa7531847452c4933d331503a5",
"version" : "2.3.1"
"revision" : "0ef1ee0220239b3776f433314515fd849025673f",
"version" : "2.6.4"
}
},
{
"identity" : "swift-argument-parser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser.git",
"state" : {
"revision" : "8f4d2753f0e4778c76d5f05ad16c74f707390531",
"version" : "1.2.3"
"revision" : "41982a3656a71c768319979febd796c6fd111d5c",
"version" : "1.5.0"
}
},
{
"identity" : "swift-syntax",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-syntax.git",
"location" : "https://github.com/swiftlang/swift-syntax.git",
"state" : {
"revision" : "6ad4ea24b01559dde0773e3d091f1b9e36175036",
"version" : "509.0.2"
"revision" : "515f79b522918f83483068d99c68daeb5116342d",
"version" : "600.0.0-prerelease-2024-08-14"
}
},
{
"identity" : "swiftlint",
"kind" : "remoteSourceControl",
"location" : "https://github.com/realm/SwiftLint.git",
"state" : {
"revision" : "f17a4f9dfb6a6afb0408426354e4180daaf49cee",
"version" : "0.54.0"
"revision" : "a24488f26e60247d8fff7bbb03d51910af3dc91c",
"version" : "0.56.2"
}
},
{
Expand All @@ -140,19 +150,19 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/xnth97/SymbolPicker.git",
"state" : {
"revision" : "1e81757fc81fdee86f48d101eab0d0f8e9e0ec3d",
"version" : "1.4.2"
"revision" : "f82b64bcc3d761c9e63aaa10b1912bba72cbf6d8",
"version" : "1.5.3"
}
},
{
"identity" : "yams",
"kind" : "remoteSourceControl",
"location" : "https://github.com/jpsim/Yams.git",
"state" : {
"revision" : "0d9ee7ea8c4ebd4a489ad7a73d5c6cad55d6fed3",
"version" : "5.0.6"
"revision" : "3036ba9d69cf1fd04d433527bc339dc0dc75433d",
"version" : "5.1.3"
}
}
],
"version" : 2
"version" : 3
}
3 changes: 1 addition & 2 deletions MiniSim/MiniSim.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ class MiniSim: NSObject {
override init() {
super.init()

settingsController.window?.delegate = self

setDefaultValues()
initObservers()

Expand Down Expand Up @@ -159,6 +157,7 @@ class MiniSim: NSObject {
if let tag = MainMenuActions(rawValue: sender.tag) {
switch tag {
case .preferences:
settingsController.window?.delegate = self
settingsController.show()
settingsController.window?.orderFrontRegardless()
case .quit:
Expand Down
105 changes: 62 additions & 43 deletions MiniSim/Views/About.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,51 +7,70 @@

import Sparkle
import SwiftUI
import AcknowList

Check warning on line 10 in MiniSim/Views/About.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Sorted Imports Violation: Imports should be sorted (sorted_imports)

struct About: View {
private let updaterController: SPUStandardUpdaterController
@Environment (\.openURL) private var openURL

init() {
updaterController = SPUStandardUpdaterController(
startingUpdater: true,
updaterDelegate: nil,
userDriverDelegate: nil
)
}

let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
private let bottomPadding: Double = 10
private let minFrameWidth: Double = 650
private let minFrameHeight: Double = 450

var body: some View {
VStack {
Image(nsImage: NSImage(named: "AppIcon") ?? NSImage())
Text("MiniSim")
.font(.title)
if let appVersion {
Text("Version: \(appVersion)")
.padding(.bottom, bottomPadding)
}
Button {
updaterController.updater.checkForUpdates()
} label: {
Label("Check for updates", systemImage: "gear")
}
.padding(.bottom, bottomPadding)

HStack {
Button("GitHub") {
openURL(URL(string: "https://github.com/okwasniewski/MiniSim")!)
}
Button("Buy me a coffee") {
openURL(URL(string: "https://github.com/sponsors/okwasniewski")!)
}
}.padding(.bottom)
Link("Created by Oskar Kwaśniewski", destination: URL(string: "https://github.com/okwasniewski")!)
.font(.caption)
private let updaterController: SPUStandardUpdaterController
@Environment (\.openURL) private var openURL
@State private var isAcknowledgementsListPresented = false

Check warning on line 16 in MiniSim/Views/About.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Trailing Whitespace Violation: Lines should not have trailing whitespace (trailing_whitespace)
init() {
updaterController = SPUStandardUpdaterController(
startingUpdater: true,
updaterDelegate: nil,
userDriverDelegate: nil
)
}

Check warning on line 24 in MiniSim/Views/About.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Trailing Whitespace Violation: Lines should not have trailing whitespace (trailing_whitespace)
let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
private let bottomPadding: Double = 10
private let minFrameWidth: Double = 650
private let minFrameHeight: Double = 450

Check warning on line 29 in MiniSim/Views/About.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Trailing Whitespace Violation: Lines should not have trailing whitespace (trailing_whitespace)
var body: some View {
VStack {
Image(nsImage: NSImage(named: "AppIcon") ?? NSImage())
Text("MiniSim")
.font(.title)
if let appVersion {
Text("Version: \(appVersion)")
.padding(.bottom, bottomPadding)
}
Button {
updaterController.updater.checkForUpdates()
} label: {
Label("Check for updates", systemImage: "gear")
}
.padding(.bottom, bottomPadding)

Check warning on line 45 in MiniSim/Views/About.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Trailing Whitespace Violation: Lines should not have trailing whitespace (trailing_whitespace)
Button("Acknowledgements") {
isAcknowledgementsListPresented.toggle()
}

Check warning on line 49 in MiniSim/Views/About.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Trailing Whitespace Violation: Lines should not have trailing whitespace (trailing_whitespace)
HStack {
Button("GitHub") {
openURL(URL(string: "https://github.com/okwasniewski/MiniSim")!)
}
.frame(minWidth: minFrameWidth, minHeight: minFrameHeight)
Button("Buy me a coffee") {
openURL(URL(string: "https://github.com/sponsors/okwasniewski")!)
}
}.padding(.bottom)
Link("Created by Oskar Kwaśniewski", destination: URL(string: "https://github.com/okwasniewski")!)
.font(.caption)
}
.sheet(isPresented: $isAcknowledgementsListPresented, content: {

Check warning on line 61 in MiniSim/Views/About.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Trailing Closure Violation: Trailing closure syntax should be used whenever possible (trailing_closure)
NavigationView {
AcknowListSwiftUIView(acknowList: AcknowParser.defaultPackages()!)
.toolbar {
ToolbarItem(placement: .automatic) {
Button("Close") {
isAcknowledgementsListPresented = false
}
}
}
}
.frame(minHeight: 450)
})
.frame(minWidth: minFrameWidth, minHeight: minFrameHeight)
}
}

0 comments on commit f8732c1

Please sign in to comment.