diff --git a/QuickDrop.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/QuickDrop.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index fa05c3b..9e4b29a 100644 --- a/QuickDrop.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/QuickDrop.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -52,7 +52,7 @@ "location" : "https://github.com/leonboe1/LUI.git", "state" : { "branch" : "main", - "revision" : "a64f79481ee613281548f3e899dde26fac9f0a89" + "revision" : "87f9d26e499b49838dc9135e063d10e1701480e9" } }, { @@ -87,8 +87,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-protobuf.git", "state" : { - "revision" : "c169a5744230951031770e27e475ff6eefe51f9d", - "version" : "1.33.3" + "revision" : "959a56cda79509e66abd367a6498951b656aa460", + "version" : "1.34.0" } }, { diff --git a/QuickDrop/AppDelegate.swift b/QuickDrop/AppDelegate.swift index 29ee850..3ad7bd8 100644 --- a/QuickDrop/AppDelegate.swift +++ b/QuickDrop/AppDelegate.swift @@ -128,6 +128,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele } log("[AppDelegate] Application did finish launching") + log("[AppDelegate] Currently running apps: \(NSWorkspace.shared.runningApplications.map { $0.localizedName ?? "-" })") } @@ -183,11 +184,17 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele switch url.host { case "sendLog": - sendLoggingString() - case "openLog": - if let url = LogManager.sharedInstance.logFileURL { - NSWorkspace.shared.activateFileViewerSelecting([url]) + // If we're in an extension, redirect to the main app + if Bundle.main.bundlePath.hasSuffix(".appex") { + log("sendLoggingString: in extension, redirecting to main app") + + if let url = URL(string: "quickdrop://sendLog") { + NSWorkspace.shared.open(url) + } + return } + + LogExportPresenter.copyLogsToClipboardAndShowAlert() case "removeData": Settings.sharedInstance.deleteAllUserDefaults() default: diff --git a/QuickDrop/Configuration.swift b/QuickDrop/Configuration.swift index e088961..713c816 100644 --- a/QuickDrop/Configuration.swift +++ b/QuickDrop/Configuration.swift @@ -43,5 +43,5 @@ let configuration = LUIConfiguration( supportsPortraitSplitView: false, - supportsDarkModeShadow: false + supportsDarkModeShadow: true ) diff --git a/QuickDrop/Util/ErrorAlertHandler.swift b/QuickDrop/Util/ErrorAlertHandler.swift index 991102f..9ab6c01 100644 --- a/QuickDrop/Util/ErrorAlertHandler.swift +++ b/QuickDrop/Util/ErrorAlertHandler.swift @@ -161,75 +161,6 @@ class ErrorAlertHandler { } -#if os(macOS) -func sendLoggingString() { - // If we're in an extension, redirect to the main app - if Bundle.main.bundlePath.hasSuffix(".appex") { - log("sendLoggingString: in extension, redirecting to main app") - - if let url = URL(string: "quickdrop://sendLog") { - NSWorkspace.shared.open(url) - } - return - } - - // We're in the main app – do the actual sending - if let url = LogManager.sharedInstance.logFileURL { - let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown" - log("Sending logging string with file URL: \(url)") - log("Currently running apps: \(NSWorkspace.shared.runningApplications.map { $0.localizedName ?? "Unknown" })") - - DispatchQueue.main.asyncAfter(deadline: .now() + 0.3, execute: { - sendEmailWithAttachment( - fileURL: url, - recipients: ["quickdrop@leonboettger.com"], - subject: "QuickDrop \(appVersion) - \(getDeviceAndSystem())" - ) - }) - } -} - - -fileprivate func getDeviceAndSystem() -> String { - // Get Mac model identifier - var size: Int = 0 - sysctlbyname("hw.model", nil, &size, nil, 0) - - var modelBuffer = [CChar](repeating: 0, count: size) - sysctlbyname("hw.model", &modelBuffer, &size, nil, 0) - - let model = String(cString: modelBuffer) - - // Get macOS version - let version = ProcessInfo.processInfo.operatingSystemVersion - let versionString = "\(version.majorVersion).\(version.minorVersion).\(version.patchVersion)" - - return "\(model) - \(versionString)" -} - - -func sendEmailWithAttachment(fileURL: URL, recipients: [String], subject: String) { - guard let emailService = NSSharingService(named: .composeEmail) else { - log("No email service available") - return - } - - emailService.recipients = recipients - emailService.subject = subject - emailService.perform(withItems: [fileURL]) - - log("Email service opened with recipients: \(recipients) and subject: \(subject)") -} - - -func copyToClipboard(_ text: String) { - let pasteboard = NSPasteboard.general - pasteboard.clearContents() - pasteboard.setString(text, forType: .string) -} -#endif - - enum AlertType: String { case ApIsolation case NetworkFilter diff --git a/QuickDrop/View/UserManual/WelcomeScreen.swift b/QuickDrop/View/UserManual/WelcomeScreen.swift index c2804e7..ef90c60 100644 --- a/QuickDrop/View/UserManual/WelcomeScreen.swift +++ b/QuickDrop/View/UserManual/WelcomeScreen.swift @@ -44,7 +44,7 @@ struct WelcomeScreen: View { Divider() ExternalLinkLabel(label: "GetSupport", icon: "questionmark.circle") { - sendLoggingString() + SupportMail.sendSupportMail() } ExternalLinkLabel(label: "PrivacyPolicy", icon: "hand.raised") {