mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-11 02:51:11 +00:00
Fix macOS 27 share extension
This commit is contained in:
1 parent
cff6b8633f
commit
167542f0fa
4 files changed
+95
-64
No files matched your search
@@ -620,13 +620,6 @@
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
F5F5F63DAC90375051BA9F4E /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
699DEB9E2AB0573200115D22 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -705,6 +698,13 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
F5F5F63DAC90375051BA9F4E /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
@@ -1374,14 +1374,6 @@
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
BECDC1522AF83179791FA522 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
A6D000000000000000000201 /* AndroidAirDropModeDetectorTests.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
699DEB9D2AB0573200115D22 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -1496,6 +1488,14 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
BECDC1522AF83179791FA522 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
A6D000000000000000000201 /* AndroidAirDropModeDetectorTests.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
EB3B9EFF2EF7150400D6704E /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -1747,49 +1747,6 @@
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
9A4E1D6A03B4FDA5B2074DF0 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = 92SDAWLN76;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
"@loader_path/../Frameworks",
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 12.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.leonboettger.neardrop.tests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = macosx;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/QuickDrop.app/Contents/MacOS/QuickDrop";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
A8C87F63E411A0C639408AC5 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = 92SDAWLN76;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
"@loader_path/../Frameworks",
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 12.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.leonboettger.neardrop.tests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = macosx;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/QuickDrop.app/Contents/MacOS/QuickDrop";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
699DEBAF2AB0573200115D22 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
@@ -1955,8 +1912,8 @@
|
||||
MTL_FAST_MATH = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
SHARED_BUILD = 151;
|
||||
SHARED_VERSION = 4.1;
|
||||
SHARED_BUILD = 152;
|
||||
SHARED_VERSION = 4.2;
|
||||
STRING_CATALOG_GENERATE_SYMBOLS = YES;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
@@ -2018,8 +1975,8 @@
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
SDKROOT = macosx;
|
||||
SHARED_BUILD = 151;
|
||||
SHARED_VERSION = 4.1;
|
||||
SHARED_BUILD = 152;
|
||||
SHARED_VERSION = 4.2;
|
||||
STRING_CATALOG_GENERATE_SYMBOLS = YES;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
@@ -2160,6 +2117,49 @@
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
9A4E1D6A03B4FDA5B2074DF0 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = 92SDAWLN76;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
"@loader_path/../Frameworks",
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 12.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.leonboettger.neardrop.tests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = macosx;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/QuickDrop.app/Contents/MacOS/QuickDrop";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
A8C87F63E411A0C639408AC5 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = 92SDAWLN76;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
"@loader_path/../Frameworks",
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 12.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.leonboettger.neardrop.tests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = macosx;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/QuickDrop.app/Contents/MacOS/QuickDrop";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
EB3B9F462EF7150400D6704E /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
|
||||
@@ -1208,4 +1208,4 @@
|
||||
}
|
||||
},
|
||||
"version" : "1.0"
|
||||
}
|
||||
}
|
||||
@@ -92,6 +92,9 @@ class ShareViewController: NSViewController, OutboundAppDelegate {
|
||||
flowLayout.minimumLineSpacing = 10
|
||||
listView!.collectionViewLayout = flowLayout
|
||||
listView!.dataSource = self
|
||||
listView!.delegate = self
|
||||
listView!.isSelectable = true
|
||||
listView!.allowsMultipleSelection = false
|
||||
|
||||
progressDeviceIconWrap!.wantsLayer = true
|
||||
progressDeviceIconWrap!.layer!.masksToBounds = false
|
||||
@@ -247,6 +250,7 @@ class ShareViewController: NSViewController, OutboundAppDelegate {
|
||||
|
||||
|
||||
func selectDevice(device: RemoteDeviceInfo) {
|
||||
guard chosenDevice == nil else { return }
|
||||
|
||||
listViewWrapper?.animator().isHidden = true
|
||||
dontSeeDeviceButton?.animator().isHidden = true
|
||||
@@ -392,7 +396,7 @@ extension ShareViewController: NSCollectionViewDataSource {
|
||||
|
||||
guard let collectionViewItem = item as? DeviceListCell else { return item }
|
||||
|
||||
let device = foundDevices[indexPath[1]]
|
||||
let device = foundDevices[indexPath.item]
|
||||
|
||||
collectionViewItem.configure(
|
||||
deviceName: getDeviceName(device: device),
|
||||
@@ -417,6 +421,20 @@ extension ShareViewController: NSCollectionViewDataSource {
|
||||
}
|
||||
|
||||
|
||||
extension ShareViewController: NSCollectionViewDelegate {
|
||||
|
||||
func collectionView(_ collectionView: NSCollectionView, didSelectItemsAt indexPaths: Set<IndexPath>) {
|
||||
guard let indexPath = indexPaths.first else { return }
|
||||
|
||||
let itemIndex = indexPath.item
|
||||
guard foundDevices.indices.contains(itemIndex) else { return }
|
||||
|
||||
collectionView.deselectItems(at: indexPaths)
|
||||
selectDevice(device: foundDevices[itemIndex])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fileprivate func openPrivacyAndSecuritySettings() {
|
||||
guard let url = URL(string: "x-apple.systempreferences:com.apple.settings.PrivacySecurity.extension") else { return }
|
||||
NSWorkspace.shared.open(url)
|
||||
|
||||
@@ -19,6 +19,11 @@ class DeviceListCell: NSCollectionViewItem {
|
||||
btn.action = #selector(onClick)
|
||||
btn.target = self
|
||||
|
||||
addClickRecognizer(to: view)
|
||||
addClickRecognizer(to: textField)
|
||||
addClickRecognizer(to: imageView)
|
||||
addClickRecognizer(to: peerMarkerView)
|
||||
|
||||
peerMarkerView?.image = NSImage(named: "MenuBarIcon")
|
||||
peerMarkerView?.image?.isTemplate = true
|
||||
peerMarkerView?.contentTintColor = .white
|
||||
@@ -34,4 +39,12 @@ class DeviceListCell: NSCollectionViewItem {
|
||||
imageView?.image = deviceImage
|
||||
peerMarkerView?.isHidden = !showsQuickDropPeerMarker
|
||||
}
|
||||
|
||||
private func addClickRecognizer(to targetView: NSView?) {
|
||||
guard let targetView else { return }
|
||||
|
||||
let recognizer = NSClickGestureRecognizer(target: self, action: #selector(onClick(_:)))
|
||||
recognizer.buttonMask = 0x1
|
||||
targetView.addGestureRecognizer(recognizer)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user