Skip to content

Commit

Permalink
feat: display app build in tray
Browse files Browse the repository at this point in the history
  • Loading branch information
marmos91 committed Jan 28, 2024
1 parent 6f9309d commit 957b7ea
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
11 changes: 9 additions & 2 deletions CubbitDS3Sync/Assets/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,15 @@
"Two-factor authentication (2FA)" : {

},
"Version %@" : {

"Version %@ (%@)" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "Version %1$@ (%2$@)"
}
}
}
},
"View in Finder" : {

Expand Down
6 changes: 4 additions & 2 deletions CubbitDS3Sync/Views/Tray/Views/TrayMenuFooterView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import SwiftUI
struct TrayMenuFooterView: View {
var status: String
var version: String
var build: String

var body: some View {
ZStack {
Expand All @@ -17,7 +18,7 @@ struct TrayMenuFooterView: View {

Spacer()

Text("Version \(version)")
Text("Version \(version) (\(build))")
.font(.custom("Nunito", size: 12))
.foregroundStyle(Color(.darkWhite))
.padding(.horizontal)
Expand All @@ -29,6 +30,7 @@ struct TrayMenuFooterView: View {
#Preview {
TrayMenuFooterView(
status: "Idle",
version: "1.0.0"
version: "1.0.0",
build: "1"
)
}
3 changes: 2 additions & 1 deletion CubbitDS3Sync/Views/Tray/Views/TrayMenuView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ struct TrayMenuView: View {

TrayMenuFooterView(
status: appStatusManager.status.toString(),
version: DefaultSettings.appVersion
version: DefaultSettings.appVersion,
build: DefaultSettings.appBuild
)
}
}
Expand Down
4 changes: 4 additions & 0 deletions DS3Lib/Constants/DefaultSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ enum DefaultSettings {
return Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "0.0.0"
}()

static let appBuild: String = {
return Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "0"
}()

static let appIsLoginItem: Bool = {
return SMAppService().status.rawValue == 1
}()
Expand Down

0 comments on commit 957b7ea

Please sign in to comment.