diff --git a/Quicksilver/Code-QuickStepInterface/QSObjectView.m b/Quicksilver/Code-QuickStepInterface/QSObjectView.m index 244b6de0b..5e5bdd6ef 100644 --- a/Quicksilver/Code-QuickStepInterface/QSObjectView.m +++ b/Quicksilver/Code-QuickStepInterface/QSObjectView.m @@ -237,11 +237,16 @@ - (NSDragOperation) draggingSourceOperationMaskForLocal:(BOOL)isLocal { else return ([[NSApp currentEvent] modifierFlags] & NSEventModifierFlagCommand) ? NSDragOperationNone : NSDragOperationEvery; } -- (void)draggedImage:(NSImage *)anImage endedAt:(NSPoint)aPoint operation:(NSDragOperation)operation { +- (void)draggingSession:(NSDraggingSession *)session endedAtPoint:(NSPoint)screenPoint operation:(NSDragOperation)operation { performingDrag = NO; -// NSLog(@"ended at %f %f %d", aPoint.x, aPoint.y, operation); - // if (operation == NSDragOperationNone) NSShowAnimationEffect(NSAnimationEffectDisappearingItemDefault, aPoint, NSZeroSize, nil, nil, nil); +// NSLog(@"ended at %f %f %d", screenPoint.x, screenPoint.y, operation); + // if (operation == NSDragOperationNone) NSShowAnimationEffect(NSAnimationEffectDisappearingItemDefault, screenPoint, NSZeroSize, nil, nil, nil); // if (operation == NSDragOperationMove) [self removeFromSuperview]; + + // Check if drag was successful (not NSDragOperationNone) and close interface if preference is set + if (operation != NSDragOperationNone && [[NSUserDefaults standardUserDefaults] boolForKey:@"QSCloseInterfaceOnSuccessfulDrop"]) { + [[self controller] hideMainWindow:self]; + } } //Dragging diff --git a/Quicksilver/Localized/en.lproj/QSAdvancedPrefPane.strings b/Quicksilver/Localized/en.lproj/QSAdvancedPrefPane.strings index 61b2981ac..aaae83e8e 100644 --- a/Quicksilver/Localized/en.lproj/QSAdvancedPrefPane.strings +++ b/Quicksilver/Localized/en.lproj/QSAdvancedPrefPane.strings @@ -26,3 +26,5 @@ "Double Delete Clears Object:title" = "Pressing the Delete key clears the whole search string"; "QSHistoryMaxLength:title" = "Number of items in Quicksilver’s history"; + +"QSCloseInterfaceOnSuccessfulDrop:title" = "Close the interface after a successful drag and drop"; diff --git a/Quicksilver/Quicksilver.xcodeproj/project.pbxproj b/Quicksilver/Quicksilver.xcodeproj/project.pbxproj index d0249f9e1..800c170f5 100644 --- a/Quicksilver/Quicksilver.xcodeproj/project.pbxproj +++ b/Quicksilver/Quicksilver.xcodeproj/project.pbxproj @@ -2205,7 +2205,7 @@ E18001D007B2BBB800010DB0 /* QSCatalogPrefPane.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = QSCatalogPrefPane.h; sourceTree = ""; usesTabs = 1; }; E18001D107B2BBB800010DB0 /* QSCatalogPrefPane.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = QSCatalogPrefPane.m; sourceTree = ""; usesTabs = 1; }; E18001D407B2BBB800010DB0 /* QSController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = QSController.h; sourceTree = ""; usesTabs = 0; }; - E18001D507B2BBB800010DB0 /* QSController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QSController.m; sourceTree = ""; usesTabs = 1; }; + E18001D507B2BBB800010DB0 /* QSController.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = QSController.m; sourceTree = ""; usesTabs = 0; }; E18001DA07B2BBB800010DB0 /* QSGetURLScriptCommand.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = QSGetURLScriptCommand.h; sourceTree = ""; usesTabs = 1; }; E18001DB07B2BBB800010DB0 /* QSGetURLScriptCommand.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = QSGetURLScriptCommand.m; sourceTree = ""; usesTabs = 1; }; E18001DC07B2BBB800010DB0 /* QSHelpersPrefPane.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = QSHelpersPrefPane.h; sourceTree = ""; usesTabs = 1; }; @@ -4245,6 +4245,7 @@ isa = PBXNativeTarget; buildConfigurationList = 7F6B3E68085CE68E000735A8 /* Build configuration list for PBXNativeTarget "Quicksilver" */; buildPhases = ( + 66CAE627153EF9AD0021BC65 /* Check Code Signing Certificate */, 8D1107270486CEB800E47090 /* Headers */, 8D1107290486CEB800E47090 /* Resources */, E1C3BE5106EA0AC500B848D6 /* Copy Plists */, @@ -4863,6 +4864,20 @@ shellPath = /bin/sh; shellScript = "# Intentionally blank -- only purpose is to tell XCode about the existence of\n# `Configuration/Quicksilver.pch`, copied in the step above, for automatic\n# dependency resolution. Without this (or something like it), one gets a race\n# condition with a lot of `/tmp/QS/Configuration/Quicksilver.pch: file not found`\n# type errors the first time XCode builds, which mysteriously resolve upon a\n# second build.\n#\n# Confirmed working alternatives to this hack:\n# - remove the `Copy Files` step above and use `cp -r` here instead\n# - Add a second (redundant) `Copy Files` step that explicitly (re-)copies `Quicksilver.pch`\n"; }; + 66CAE627153EF9AD0021BC65 /* Check Code Signing Certificate */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Check Code Signing Certificate"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# Check if Local Self-Signed certificate exists, fail if not found\n\nset -euf\n\n# Skip this check if running on GitHub CI\nif [ \"${CI:-}\" = \"true\" ] && [ \"${GITHUB_ACTIONS:-}\" = \"true\" ]; then\n echo \"Running on GitHub CI - skipping certificate check\"\n exit 0\nfi\n\n# Check if the Local Self-Signed certificate exists in the keychain\nif ! security find-identity -v -p codesigning | grep -q \"Local Self-Signed\"; then\n echo \"ERROR: Local Self-Signed certificate not found!\"\n echo \"Please run the following command to set up code signing:\"\n echo \" ${SRCROOT}/Tools/codesign/setup_cert.sh\"\n echo \"\"\n echo \"This will create a self-signed certificate for local development.\"\n exit 1\nelse\n echo \"Local Self-Signed certificate found.\"\nfi\n"; + }; 66CAE628153EF9AE0021BC65 /* Adjust Version-String */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; diff --git a/Quicksilver/Resources/DefaultsMap.plist b/Quicksilver/Resources/DefaultsMap.plist index 47442ef61..167c4cbb3 100644 --- a/Quicksilver/Resources/DefaultsMap.plist +++ b/Quicksilver/Resources/DefaultsMap.plist @@ -132,5 +132,15 @@ type text + + category + Command + default + QSCloseInterfaceOnSuccessfulDrop + title + Close the interface after a successful drag and drop + type + checkbox +