Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two separate services (one internal and one not) can be confusing #409

Closed
pjrobertson opened this issue Jul 3, 2011 · 10 comments
Closed
Assignees
Milestone

Comments

@pjrobertson
Copy link
Member

We should try and create a single service, that is clever enough to detect if the service was called by Quicksilver (when CMD+G is pressed or the 'current selection' proxy is used) or if it was called by the user (using the global hotkey or App->Services->Send to Quicksilver.)

I'm not currently aware on the differences between the code for the two services, but it could easily be integrated into a single service with a simple if ... else ... statement

In implementing this, we'd need to make sure we do not mess with the user's shortcut key for the 'send to quicksilver' service. This would probably mean making the invokeSercive method in QSGlobalSelectionProvider.m dynamically set the keys to press depending on the user's choice.
Or set two hotkeys if this is possible.

@skurfer
Copy link
Member

skurfer commented Jul 6, 2011

I don’t know much about how Services are implemented, but I wonder why “Get Current Selection (Internal)” needed to be exposed as a Service to begin with. Do Services have visibility of the system’s state that an application can’t get on its own maybe?

Anyway, I completely agree. There should be one chunk of code that handles this for the Service, ⌘G, Current Selection, Finder Selection, etc.

@ghost ghost self-assigned this Jul 26, 2011
@anatomatic
Copy link

I would add that CMD-Escape should be default for this unified service, seeing as you can't set Escape to any hot-key in Lion. This would always give the option of "resetting to default" to get CMD-Escape.

@skurfer
Copy link
Member

skurfer commented Aug 26, 2011

I’ll add this here, in the hopes that we can fix it at the same time.

Often, when “grabbing” files into Quicksilver, you end up with the parent folder of the selection. This seems to happen more with the Current Selection proxy and ⌘G/⌥⌘G, and not with the service(s), but like I said, hopefully this code can be consolidated.

@skurfer
Copy link
Member

skurfer commented Sep 21, 2011

See also: #485

@pjrobertson
Copy link
Member Author

@neurolepsy Are you OK with me re-assigning myself to the issue? If you've got any work in progress let me know and I can take it from there.

I posted this in a closed issue, but it's probably more applicable here:

For the developers

So I've started looking into this, since the ⌘⎋ shortcut doesn't work on the Mac at work. Interestingly enough, this is not the fault of QS, but the fault of the keyboard (?!?). The ⌘⎋ just doesn't seem to work AT ALL. I've installed key codes and when I press ⌘⎋ it doesn't register. All other shortcuts do. This is on 10.7.4, new Mac Mini with an Apple keyboard
(P.S. international English is so annoying. Where's the £ sign?!)

The intersesting thing, however, is that when QS simulates the ⌘⎋ keystrokes using carbon (in QSGlobalSelectionProvider.m invokeService) it does work (this is invoked when you use the 'current selection' object with the 'pull selection from frontmost app' option enabled.

Seeing as there seems to be this huge limitation with ⌘⎋ not actually registering as a keyboard shortcut, here's what I propose:

  • We remove the 'send to quicksilver' service
  • We keep the get current selection (internal) service, but rename it to something more obvious so as it isn't changed. e.g. Quicksilver Internal Selection (Private)
  • We make a new default trigger called 'get selection' that literally just does select current selection in command window. People would be told NOT to touch the ⌘⎋ shortcut in the keyboard preferences (if they do, things will) but to edit the trigger keyboard shortcut.
  • For those who still like the ⌘⎋ shortcut, and for whom it still works, since it'll still be enabled (as a 'private' service) you can still use that.
  • Added bonus: Using the current selection proxy works more consistently than the service in Finder (e.g. try the service on a folder in Finder when in column mode) so it should fix a few problems

Once we're down to one service, I'll start working on the few bugs with the 'current selection' proxy :)

@ghost
Copy link

ghost commented Sep 26, 2012

@pjrobertson Go for it, I never got around to doing anything about this issue.

@ghost ghost assigned pjrobertson Sep 26, 2012
@skurfer
Copy link
Member

skurfer commented Sep 26, 2012

We remove the 'send to quicksilver' service

OK.

We keep the get current selection (internal) service, but rename it to something more obvious so as it isn't changed. e.g. Quicksilver Internal Selection (Private)

Is there a reason we should discourage people from using it like any other service (with things like "Internal" and "Private" in the name)? They obviously just use it anyway. :-)

We make a new default trigger called 'get selection' that literally just does select current selection in command window.

You know there’s already a trigger by default called "Command Window with Selection", right? :-) And it doesn't just show the "Current Selection" proxy object. It actually resolves the selection into something.

There have always been little problems with one method or the other. As I said (on IRC), it used to be that one method couldn't get multiple files from Finder, but the other would grab the current URL instead of the selected text in a browser. This could be solved by using both (with the trigger scoped to applications where it was the best choice) until scopes broke in 10.5.

Testing out the trigger in various scenarios, it does appear to work pretty consistently. Some minor issues:

  • It still grabs the URL instead of the text, but only in OmniWeb, which is surely dying if not dead. :-(
  • It sometimes works great in Finder, but often grabs the parent folder instead of the selected file(s).

But if we can solve that second problem, the trigger could be the way of the future. :-)

Update

It might be getting the previous selection, not the parent folder, so maybe it's a caching issue.

@pjrobertson
Copy link
Member Author

Is there a reason we should discourage people from using it like any
other service (with things like "Internal" and "Private" in the name)? They
obviously just use it anyway. :-)

Yes. We don't want people thinking they can use it and customise the
keyboard shortcut in the keyboard system prefs. If they do that, then all
the proxies that use the hard coded ⌘⎋ break.

You know there’s already a trigger by default called "Command Window with
Selection", right? :-) And it doesn't just show the "Current Selection"
proxy object. It actually resolves the selection into something.

I do know ;-)
Sounds like the current selection works pretty well now. I'm in the prices
of fixing some of the things you mention, so we'll take it from there.

On 26 September 2012 19:46, Rob McBroom notifications@github.com wrote:

We remove the 'send to quicksilver' service

OK.

We keep the get current selection (internal) service, but rename it to
something more obvious so as it isn't changed. e.g. Quicksilver Internal
Selection (Private)

Is there a reason we should discourage people from using it like any other
service (with things like "Internal" and "Private" in the name)? They
obviously just use it anyway. :-)

We make a new default trigger called 'get selection' that literally just
does select current selection in command window.

You know there’s already a trigger by default called "Command Window with
Selection", right? :-) And it doesn't just show the "Current Selection"
proxy object. It actually resolves the selection into something.

There have always been little problems with one method or the other. As I
said (on IRC), it used to be that one method couldn't get multiple files
from Finder, but the other would grab the current URL instead of the
selected text in a browser. This could be solved by using both (with the
trigger scoped to applications where it was the best choice) until scopes
broke in 10.5.

Testing out the trigger in various scenarios, it does appear to work
pretty consistently. Some minor issues:

  • It still grabs the URL instead of the text, but only in OmniWeb,
    which is surely dying if not dead. :-(
  • It sometimes works great in Finder, but often grabs the parent
    folder instead of the selected file(s).

But if we can solve that second problem, the trigger could be the way of
the future. :-)


Reply to this email directly or view it on GitHubhttps://github.com//issues/409#issuecomment-8900627.

@skurfer
Copy link
Member

skurfer commented Sep 26, 2012

OK, that's a good point. But it's OK to use, just not to change the shortcut. I suppose "Get Current Selection (Don't Change the Shortcut)" is out? ;-)

@pjrobertson
Copy link
Member Author

OK, that's a good point. But it's OK to use, just not to change the
shortcut. I suppose "Get Current Selection (Don't Change the Shortcut)" is
out? ;-)

I'll let you do the localising :P

On 26 September 2012 20:58, Rob McBroom notifications@github.com wrote:

OK, that's a good point. But it's OK to use, just not to change the
shortcut. I suppose "Get Current Selection (Don't Change the Shortcut)" is
out? ;-)


Reply to this email directly or view it on GitHubhttps://github.com//issues/409#issuecomment-8903005.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants