diff --git a/LeCountdown/Utils/Extensions.swift b/LeCountdown/Utils/Extensions.swift index c821ccf..59ed165 100644 --- a/LeCountdown/Utils/Extensions.swift +++ b/LeCountdown/Utils/Extensions.swift @@ -38,6 +38,7 @@ extension String: StringRepresentable { } extension Bundle { + var applicationName: String { if let displayName: String = self.localizedInfoDictionary?["CFBundleDisplayName"] as? String { return displayName @@ -48,4 +49,9 @@ extension Bundle { } return "No Name Found" } + + var version: String { + return Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? "no version" + } + } diff --git a/LeCountdown/Utils/UIDevice+Extensions.swift b/LeCountdown/Utils/UIDevice+Extensions.swift index 022b121..239e077 100644 --- a/LeCountdown/Utils/UIDevice+Extensions.swift +++ b/LeCountdown/Utils/UIDevice+Extensions.swift @@ -17,4 +17,15 @@ extension UIDevice { @objc static var isPhoneIdiom: Bool { return UIDevice.current.userInterfaceIdiom == .phone } + + static var modelName: String { + var systemInfo = utsname() + uname(&systemInfo) + let machineMirror = Mirror(reflecting: systemInfo.machine) + return machineMirror.children.reduce("") { identifier, element in + guard let value = element.value as? Int8, value != 0 else { return identifier } + return identifier + String(UnicodeScalar(UInt8(value))) + } + } + } diff --git a/LeCountdown/Views/ContentView.swift b/LeCountdown/Views/ContentView.swift index e0fc612..d7c755b 100644 --- a/LeCountdown/Views/ContentView.swift +++ b/LeCountdown/Views/ContentView.swift @@ -189,7 +189,7 @@ struct MainToolbarView: ToolbarContent { NavigationStack { SettingsView() .navigationBarTitleDisplayMode(.inline) - }.presentationDetents([.height(360.0)]) + }.presentationDetents([.height(400.0)]) }) } Button { @@ -246,7 +246,8 @@ class TimerSpot : Identifiable, Equatable { struct Toolbar_Previews: PreviewProvider { static var previews: some View { NavigationStack { - Text(NSLocalizedString("Disclaimer", comment: "")).padding(32.0).multilineTextAlignment(.center) + ContentView() + .environmentObject(Conductor.maestro) } .navigationTitle("Title") .toolbar { diff --git a/LeCountdown/Views/Reusable/MailView.swift b/LeCountdown/Views/Reusable/MailView.swift index 746833e..01f72b6 100644 --- a/LeCountdown/Views/Reusable/MailView.swift +++ b/LeCountdown/Views/Reusable/MailView.swift @@ -36,7 +36,7 @@ struct MailView: UIViewControllerRepresentable { let vc = MFMailComposeViewController() vc.mailComposeDelegate = context.coordinator - vc.setSubject(Bundle.main.applicationName) + vc.setSubject("\(Bundle.main.applicationName) - \(Bundle.main.version) - iOS \(UIDevice.current.systemVersion) - \(UIDevice.modelName)") vc.setToRecipients([URLs.mail.rawValue]) let lastLogs = FileLogger.main.logs.suffix(40).reversed() diff --git a/LeCountdown/Views/SettingsView.swift b/LeCountdown/Views/SettingsView.swift index 97df472..e398eb5 100644 --- a/LeCountdown/Views/SettingsView.swift +++ b/LeCountdown/Views/SettingsView.swift @@ -26,17 +26,11 @@ struct SettingsView: View { .onChange(of: self.confirmationSound) { newValue in Preferences.playConfirmationSound = newValue } -// Toggle("Play cancellation sound", isOn: self.$cancellationSound) -// .onChange(of: self.cancellationSound) { newValue in -// Preferences.playCancellationSound = newValue -// } - - Toggle("Raise sound on launch", isOn: self.$raiseSoundOnLaunch) + Toggle("Adjust volume on launch", isOn: self.$raiseSoundOnLaunch) .onChange(of: self.raiseSoundOnLaunch) { newValue in Preferences.raiseSoundOnLaunch = newValue } - if self.raiseSoundOnLaunch { HStack { @@ -54,7 +48,7 @@ struct SettingsView: View { Button { self.showMailView = true } label: { - Text("Contact us") + Label("Contact us", systemImage: "mail") } } else { if self.emailCopied { @@ -96,7 +90,6 @@ struct SettingsView: View { MailView(isShowing: $showMailView) } .navigationTitle("Settings") - } diff --git a/LeCountdown/fr.lproj/Localizable.strings b/LeCountdown/fr.lproj/Localizable.strings index 8c994b1..dcc9bae 100644 --- a/LeCountdown/fr.lproj/Localizable.strings +++ b/LeCountdown/fr.lproj/Localizable.strings @@ -291,3 +291,4 @@ "Copied" = "Copié"; "tap to copy email" = "Tapez pour copier l'email"; "Write a review!" = "Écrivez un avis !"; +"Adjust volume on launch" = "Ajuster le volume au lancement";