Remove auto-copy toggle, use clipboard preservation
This commit is contained in:
parent
a97d0107af
commit
376781d691
@ -15,7 +15,7 @@ struct GeneralSettings: Codable {
|
||||
let recorderType: String?
|
||||
let isAudioCleanupEnabled: Bool?
|
||||
let audioRetentionPeriod: Int?
|
||||
let isAutoCopyEnabled: Bool?
|
||||
|
||||
let isSoundFeedbackEnabled: Bool?
|
||||
let isSystemMuteEnabled: Bool?
|
||||
let isPauseMediaEnabled: Bool?
|
||||
@ -46,7 +46,7 @@ class ImportExportService {
|
||||
private let keyRecorderType = "RecorderType"
|
||||
private let keyIsAudioCleanupEnabled = "IsAudioCleanupEnabled"
|
||||
private let keyAudioRetentionPeriod = "AudioRetentionPeriod"
|
||||
private let keyIsAutoCopyEnabled = "IsAutoCopyEnabled"
|
||||
|
||||
private let keyIsSoundFeedbackEnabled = "isSoundFeedbackEnabled"
|
||||
private let keyIsSystemMuteEnabled = "isSystemMuteEnabled"
|
||||
private let keyIsTextFormattingEnabled = "IsTextFormattingEnabled"
|
||||
@ -91,7 +91,7 @@ class ImportExportService {
|
||||
recorderType: whisperState.recorderType,
|
||||
isAudioCleanupEnabled: UserDefaults.standard.bool(forKey: keyIsAudioCleanupEnabled),
|
||||
audioRetentionPeriod: UserDefaults.standard.integer(forKey: keyAudioRetentionPeriod),
|
||||
isAutoCopyEnabled: whisperState.isAutoCopyEnabled,
|
||||
|
||||
isSoundFeedbackEnabled: soundManager.isEnabled,
|
||||
isSystemMuteEnabled: mediaController.isSystemMuteEnabled,
|
||||
isPauseMediaEnabled: playbackController.isPauseMediaEnabled,
|
||||
@ -241,9 +241,7 @@ class ImportExportService {
|
||||
if let audioRetention = general.audioRetentionPeriod {
|
||||
UserDefaults.standard.set(audioRetention, forKey: self.keyAudioRetentionPeriod)
|
||||
}
|
||||
if let autoCopy = general.isAutoCopyEnabled {
|
||||
whisperState.isAutoCopyEnabled = autoCopy
|
||||
}
|
||||
|
||||
if let soundFeedback = general.isSoundFeedbackEnabled {
|
||||
soundManager.isEnabled = soundFeedback
|
||||
}
|
||||
|
||||
@ -117,18 +117,6 @@ struct MenuBarView: View {
|
||||
.disabled(!enhancementService.isEnhancementEnabled)
|
||||
|
||||
Menu("Additional") {
|
||||
Button {
|
||||
whisperState.isAutoCopyEnabled.toggle()
|
||||
} label: {
|
||||
HStack {
|
||||
Text("Auto-copy to Clipboard")
|
||||
Spacer()
|
||||
if whisperState.isAutoCopyEnabled {
|
||||
Image(systemName: "checkmark")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
SoundManager.shared.isEnabled.toggle()
|
||||
menuRefreshTrigger.toggle()
|
||||
|
||||
@ -112,11 +112,6 @@ struct SettingsView: View {
|
||||
subtitle: "Customize app & system feedback"
|
||||
) {
|
||||
VStack(alignment: .leading, spacing: 12) {
|
||||
Toggle(isOn: $whisperState.isAutoCopyEnabled) {
|
||||
Text("Auto-copy to clipboard")
|
||||
}
|
||||
.toggleStyle(.switch)
|
||||
|
||||
Toggle(isOn: .init(
|
||||
get: { SoundManager.shared.isEnabled },
|
||||
set: { SoundManager.shared.isEnabled = $0 }
|
||||
|
||||
@ -27,11 +27,7 @@ class WhisperState: NSObject, ObservableObject {
|
||||
@Published var clipboardMessage = ""
|
||||
@Published var miniRecorderError: String?
|
||||
@Published var shouldCancelRecording = false
|
||||
@Published var isAutoCopyEnabled: Bool = UserDefaults.standard.object(forKey: "IsAutoCopyEnabled") as? Bool ?? true {
|
||||
didSet {
|
||||
UserDefaults.standard.set(isAutoCopyEnabled, forKey: "IsAutoCopyEnabled")
|
||||
}
|
||||
}
|
||||
|
||||
@Published var recorderType: String = UserDefaults.standard.string(forKey: "RecorderType") ?? "mini" {
|
||||
didSet {
|
||||
UserDefaults.standard.set(recorderType, forKey: "RecorderType")
|
||||
@ -350,11 +346,7 @@ class WhisperState: NSObject, ObservableObject {
|
||||
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) {
|
||||
|
||||
CursorPaster.pasteAtCursor(text, shouldPreserveClipboard: !self.isAutoCopyEnabled)
|
||||
|
||||
if self.isAutoCopyEnabled {
|
||||
ClipboardManager.copyToClipboard(text)
|
||||
}
|
||||
CursorPaster.pasteAtCursor(text, shouldPreserveClipboard: true)
|
||||
|
||||
// Automatically press Enter if the active Power Mode configuration allows it.
|
||||
let powerMode = PowerModeManager.shared
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user