mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-11 02:51:11 +00:00
Fix issue that prevented sharing files
This commit is contained in:
1 parent
044753efb1
commit
eb32603c5f
3 files changed
+5560
-5068
No files matched your search
@@ -224,6 +224,9 @@
|
||||
EB5C38412E38C49D0052EFD7 /* LaunchAtLogin.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB5C383E2E38C49D0052EFD7 /* LaunchAtLogin.swift */; };
|
||||
EB6E51A52F2F9370006D9812 /* IntroductionSheetManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB6E51A42F2F9370006D9812 /* IntroductionSheetManager.swift */; };
|
||||
EB6E51A62F2F9370006D9812 /* IntroductionSheetManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB6E51A42F2F9370006D9812 /* IntroductionSheetManager.swift */; };
|
||||
EB6E51AB2F311ED4006D9812 /* QuickDropIcon.icon in Resources */ = {isa = PBXBuildFile; fileRef = EB721F232E75AFA900F2099F /* QuickDropIcon.icon */; };
|
||||
EB6E51AC2F311ED4006D9812 /* QuickDropIcon.icon in Resources */ = {isa = PBXBuildFile; fileRef = EB721F232E75AFA900F2099F /* QuickDropIcon.icon */; };
|
||||
EB6E51AD2F311ED4006D9812 /* QuickDropIcon.icon in Resources */ = {isa = PBXBuildFile; fileRef = EB721F232E75AFA900F2099F /* QuickDropIcon.icon */; };
|
||||
EB6E6AB42ECBA46D00E71D57 /* PhotoManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBBEE1452EC9D92F00AA7831 /* PhotoManager.swift */; };
|
||||
EB6E6B212ECBA95000E71D57 /* InfoPlist.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = EB6E6B202ECBA95000E71D57 /* InfoPlist.xcstrings */; };
|
||||
EB6E6B222ECBA95000E71D57 /* InfoPlist.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = EB6E6B202ECBA95000E71D57 /* InfoPlist.xcstrings */; };
|
||||
@@ -1158,6 +1161,7 @@
|
||||
files = (
|
||||
EBD6AFBC2EF826E600DED4CD /* ConfigSynced.storekit in Resources */,
|
||||
EB5C36942E34EBBD0052EFD7 /* Localizable.xcstrings in Resources */,
|
||||
EB6E51AB2F311ED4006D9812 /* QuickDropIcon.icon in Resources */,
|
||||
EB5C36E52E34EC0E0052EFD7 /* License.txt in Resources */,
|
||||
691F53BC2ABB70840089FD92 /* DeviceListCell.xib in Resources */,
|
||||
699DEBA92AB0573200115D22 /* ShareViewController.xib in Resources */,
|
||||
@@ -1206,6 +1210,7 @@
|
||||
files = (
|
||||
EBD6AFC02EF826E600DED4CD /* ConfigSynced.storekit in Resources */,
|
||||
EB3B9F7D2EF7151900D6704E /* Localizable.xcstrings in Resources */,
|
||||
EB6E51AD2F311ED4006D9812 /* QuickDropIcon.icon in Resources */,
|
||||
EB3B9F7E2EF7151900D6704E /* License.txt in Resources */,
|
||||
EB3B9F7F2EF7151900D6704E /* DeviceListCell.xib in Resources */,
|
||||
EB3B9F802EF7151900D6704E /* ShareViewController.xib in Resources */,
|
||||
@@ -1239,6 +1244,7 @@
|
||||
EB1325FE2E7034B000FD749C /* InfoPlist.xcstrings in Resources */,
|
||||
EB950B702E520734002D68FA /* Localizable.xcstrings in Resources */,
|
||||
EBD6AFBE2EF826E600DED4CD /* ConfigSynced.storekit in Resources */,
|
||||
EB6E51AC2F311ED4006D9812 /* QuickDropIcon.icon in Resources */,
|
||||
EB950B5C2E52065A002D68FA /* justMaybe.mp3 in Resources */,
|
||||
EB950B5D2E52065A002D68FA /* License.txt in Resources */,
|
||||
EB7654C12E534A8E006B4AA3 /* Assets.xcassets in Resources */,
|
||||
@@ -1737,8 +1743,8 @@
|
||||
MTL_FAST_MATH = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
SHARED_BUILD = 114;
|
||||
SHARED_VERSION = 2.11;
|
||||
SHARED_BUILD = 116;
|
||||
SHARED_VERSION = 2.12;
|
||||
STRING_CATALOG_GENERATE_SYMBOLS = YES;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
@@ -1800,8 +1806,8 @@
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
SDKROOT = macosx;
|
||||
SHARED_BUILD = 114;
|
||||
SHARED_VERSION = 2.11;
|
||||
SHARED_BUILD = 116;
|
||||
SHARED_VERSION = 2.12;
|
||||
STRING_CATALOG_GENERATE_SYMBOLS = YES;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
|
||||
+5519
-5053
File diff suppressed because it is too large.
Load diff
@@ -5,10 +5,11 @@
|
||||
// Created by Grishka on 12.09.2023.
|
||||
//
|
||||
|
||||
import AppKit
|
||||
import Cocoa
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
import LUI
|
||||
import SwiftUI
|
||||
|
||||
class ShareViewController: NSViewController, OutboundAppDelegate {
|
||||
|
||||
@@ -54,7 +55,7 @@ class ShareViewController: NSViewController, OutboundAppDelegate {
|
||||
|
||||
loadAttachments(with: extensionContext, loadedItems: { result in
|
||||
|
||||
log("Loaded attachments: \(result)")
|
||||
log("[ShareViewController] Loaded attachments: \(result)")
|
||||
|
||||
self.urls = result.urls
|
||||
self.textToSend = result.textToSend
|
||||
@@ -107,7 +108,7 @@ class ShareViewController: NSViewController, OutboundAppDelegate {
|
||||
|
||||
|
||||
override func viewWillDisappear() {
|
||||
log("ShareViewController: viewWillDisappear")
|
||||
log("[ShareViewController] ShareViewController: viewWillDisappear")
|
||||
|
||||
timeoutDispatchWorkItem?.cancel()
|
||||
|
||||
@@ -268,15 +269,25 @@ class ShareViewController: NSViewController, OutboundAppDelegate {
|
||||
alert.alertStyle = .critical
|
||||
|
||||
alert.messageText = "TimeoutTitle".localized()
|
||||
alert.informativeText = "TimeoutDescription".localized()
|
||||
alert.addButton(withTitle: "TimeoutButton".localized())
|
||||
|
||||
alert.beginSheetModal(for: self.view.window!) { _ in }
|
||||
if #available(macOS 15.0, *) {
|
||||
alert.informativeText = "TimeoutDescription".localized()
|
||||
alert.addButton(withTitle: "TimeoutButton".localized())
|
||||
} else {
|
||||
alert.informativeText = "TimeoutDescriptionLegacy".localized()
|
||||
alert.addButton(withTitle: "TimeoutButtonLegacy".localized())
|
||||
}
|
||||
|
||||
alert.beginSheetModal(for: self.view.window!) { _ in
|
||||
if #available(macOS 15.0, *) {
|
||||
openPrivacyAndSecuritySettings()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.timeoutDispatchWorkItem = timeoutAlert
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 10.0, execute: timeoutAlert)
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 10.0, execute: timeoutAlert)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -301,18 +312,18 @@ class ShareViewController: NSViewController, OutboundAppDelegate {
|
||||
let isRunning = runningApps.contains { $0.bundleIdentifier == bundleIdentifier }
|
||||
|
||||
if !isRunning {
|
||||
log("Launching main app")
|
||||
log("[ShareViewController] Launching main app")
|
||||
if let url = NSWorkspace.shared.urlForApplication(withBundleIdentifier: bundleIdentifier) {
|
||||
let configuration = NSWorkspace.OpenConfiguration()
|
||||
NSWorkspace.shared.openApplication(at: url, configuration: configuration) { app, error in
|
||||
if let error = error {
|
||||
log("Failed to launch application: \(error)")
|
||||
log("[ShareViewController] Failed to launch application: \(error)")
|
||||
} else {
|
||||
log("Application launched successfully")
|
||||
log("[ShareViewController] Application launched successfully")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
log("Could not find application with bundle identifier \(bundleIdentifier)")
|
||||
log("[ShareViewController] Could not find application with bundle identifier \(bundleIdentifier)")
|
||||
}
|
||||
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
|
||||
@@ -324,6 +335,9 @@ class ShareViewController: NSViewController, OutboundAppDelegate {
|
||||
NearbyConnectionManager.shared.startDeviceDiscovery()
|
||||
scheduleAutomaticQrCodeView()
|
||||
}
|
||||
|
||||
// Force local network access prompt if not already granted
|
||||
let _ = DeviceToDeviceHeuristicScanner.shared.hasLocalNetworkAccess(completion: {_ in })
|
||||
}
|
||||
|
||||
|
||||
@@ -389,3 +403,9 @@ extension ShareViewController: NSCollectionViewDataSource {
|
||||
return "UnknownDevice".localized()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fileprivate func openPrivacyAndSecuritySettings() {
|
||||
guard let url = URL(string: "x-apple.systempreferences:com.apple.settings.PrivacySecurity.extension") else { return }
|
||||
NSWorkspace.shared.open(url)
|
||||
}
|
||||
Reference in new issue
Block a user