diff --git a/LinkLiar/Classes/Config/Builder.swift b/LinkLiar/Classes/Config/Builder.swift index fe8be90..a667a91 100644 --- a/LinkLiar/Classes/Config/Builder.swift +++ b/LinkLiar/Classes/Config/Builder.swift @@ -227,11 +227,15 @@ extension Config { // MARK: General Settings - func dismissRecommendedSettings() -> [String: Any] { + func resetRecommendedSettings() -> [String: Any] { var dictionary = configDictionary + dictionary.removeValue(forKey: Config.Key.recommendation.rawValue) + return dictionary + } + func dismissRecommendedSettings() -> [String: Any] { + var dictionary = configDictionary dictionary[Config.Key.recommendation.rawValue] = false - return dictionary } diff --git a/LinkLiar/Classes/Config/Writer.swift b/LinkLiar/Classes/Config/Writer.swift index b334cb7..8d7229c 100644 --- a/LinkLiar/Classes/Config/Writer.swift +++ b/LinkLiar/Classes/Config/Writer.swift @@ -153,9 +153,19 @@ extension Config { setFallbackInterfaceAction(.random) } + denyRerandomization() removeAllVendors() } + func resetRecommendedSettings() { + var newDictionary = Config.Builder(state.configDictionary).resetRecommendedSettings() + + newDictionary[Config.Key.version.rawValue] = state.version.formatted + if JSONWriter(Paths.configFile).write(newDictionary) { + state.configDictionary = newDictionary + } + } + func dismissRecommendedSettings() { var newDictionary = Config.Builder(state.configDictionary).dismissRecommendedSettings() diff --git a/LinkLiar/Views/Settings/Sections/CommunityView.swift b/LinkLiar/Views/Settings/Sections/CommunityView.swift index 1ce3fe7..4a45a0f 100644 --- a/LinkLiar/Views/Settings/Sections/CommunityView.swift +++ b/LinkLiar/Views/Settings/Sections/CommunityView.swift @@ -12,6 +12,7 @@ extension SettingsView { VStack(alignment: .center) { Image(systemName: "bubble.left.and.bubble.right.fill") .resizable() + .symbolRenderingMode(.hierarchical) .aspectRatio(contentMode: .fill) .frame(width: 60, height: 60) .padding(.bottom, 3) diff --git a/LinkLiar/Views/Settings/Sections/FaqView.swift b/LinkLiar/Views/Settings/Sections/FaqView.swift index 084d1e3..3346c8d 100644 --- a/LinkLiar/Views/Settings/Sections/FaqView.swift +++ b/LinkLiar/Views/Settings/Sections/FaqView.swift @@ -33,7 +33,7 @@ extension SettingsView { HStack { Text(""" You original hardware MAC address will be revealed when you cold boot your computer and Wi-Fi \ - is turned on. MAC address modifications do persist when sleeping and waking your computer, however. + is turned on. However, MAC address modifications do persist when sleeping and waking your computer. """) Spacer() } @@ -43,7 +43,7 @@ extension SettingsView { HStack { Text(""" The MAC address of an interface cannot be modified while connected to a Wi-Fi network. \ - That's why LinkLiar will disassociate from any connected network before modifying the MAC address. + That's why LinkLiar will disassociate from any connected network before attempting to modify the MAC address. """) Spacer() } @@ -51,7 +51,10 @@ extension SettingsView { GroupBox("Wi-Fi needs to be on for MAC modification.", content: { HStack { - Text("When your Wi-Fi (aka Airport) is turned off, you cannot change its MAC address. You might need to turn it on first.") + Text(""" + "When your Wi-Fi (aka Airport) is turned off, you cannot change its MAC address. \ + You might need to turn it on first. + """) Spacer() } }).padding(.bottom) diff --git a/LinkLiar/Views/Settings/Sections/PreferencesView.swift b/LinkLiar/Views/Settings/Sections/PreferencesView.swift index 43dd981..c420b20 100644 --- a/LinkLiar/Views/Settings/Sections/PreferencesView.swift +++ b/LinkLiar/Views/Settings/Sections/PreferencesView.swift @@ -81,6 +81,39 @@ extension SettingsView { }.padding(4) } + GroupBox { + HStack(alignment: .top) { + let warnOnIdleSettings = Binding( + get: { !state.config.general.isDismissingRecommendation }, + set: { value, _ in + value ? Config.Writer(state).resetRecommendedSettings() : + Config.Writer(state).dismissRecommendedSettings() + } + ) + + VStack(alignment: .leading, spacing: 3) { + Text("Warn about no-op configuration") + if warnOnIdleSettings.wrappedValue { + Text(""" + If LinkLiar is configured to not do anything, warn about that. + """) + .font(.caption) + .foregroundColor(.secondary) + } else { + Text(""" + Don't notify about settings that have no effect. + """) + .font(.caption) + .foregroundColor(.secondary) + } + } + Spacer() + Toggle(isOn: warnOnIdleSettings) {} + .toggleStyle(.switch) + .controlSize(.small) + }.padding(4) + } + }.padding() } } diff --git a/LinkLiar/Views/Settings/Sections/WelcomeView.swift b/LinkLiar/Views/Settings/Sections/WelcomeView.swift index 059b34d..3dd4aac 100644 --- a/LinkLiar/Views/Settings/Sections/WelcomeView.swift +++ b/LinkLiar/Views/Settings/Sections/WelcomeView.swift @@ -14,6 +14,7 @@ extension SettingsView { VStack(alignment: .center) { Image(systemName: "hands.and.sparkles.fill") .resizable() + .symbolRenderingMode(.hierarchical) .aspectRatio(contentMode: .fill) .frame(width: 60, height: 60) .padding(.bottom, 3)