-
Notifications
You must be signed in to change notification settings - Fork 55
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
Ability to specify default conversion target #13
Comments
I've also recently wanted something similar to this. I kinda want to give this a shot, but recently I haven't had a whole lot of free time. @deanishe , if I did give this a shot, any suggestions on how you would like it to work or how you would prefer to have it structured. |
I think it's an awesome idea! It'd definitely be a big step forward for the workflow. The only problem I have with it is the effort involved 😉 So, the goal is for the user to be able to specify a bunch of their favourite units, right? So, they can favourite, say, USD and EUR, and if they enter Is that right? Currencies are fairly easy to do because the workflow itself knows which currencies are available. That isn't true of any other kind of unit. (That's the reason you can view the list of currencies in the settings, but no other units.) It just parses the query and feeds it into You may just have to let the user save a whole list of units, e.g.:
And then try to convert any valid query to each quantity in turn, only displaying the results for the conversions that don't throw errors. Thus, if the user enters |
I haven't thought much about the UI for how it works, more of just how I imagined it working for myself. You could define a dictionary of units that you wanted auto converted. For example
etc Then when the workflow parses, if the unit isn't selected yet, example
Very ugly psudo code since I don't have the actual code open right now, but that was my rough idea about how it might work. |
Regarding currencies, as you said it should be easy enough. For other pint measurements I played with Pint's API a bit, and here is one way it could work (looking at the code here) User input: 5 ton in gram
Alfred: Do you want to automatically convert "mass" units in the future to "gram"?
User input: 5 ton
This will allow the user to avoid pre-defining all the units and allow him to define everything only if he needs it. Thoughts? |
So you're thinking you could specify, say, Is that right? |
@deanishe Err... Whom are you replying to? 😄 |
Ahh, I hadn't even thought of CMD+Enter (Ctrl+Enter, etc) as a way to control the favorites list, but that seems like it could be a good way to handle it. @deanishe what are your feelings for trying to continue to support Alfred 2 or is requiring Alfred 3 safe? Without looking at the code, I don't think it would be too difficult to still support Alfred 2, but I seem to recall some changes around how the modifier keys worked with filter lists that could make it easier to implement if only Alfred 3 is supported. |
I think CMD+ENTER in the conversion results list to add/remove favourite units would be a good UX, and relatively simple to implement. Regarding Alfred 3: I don't think any of its new features are a compelling fit for this workflow. Additionally, there's a fundamental issue with the Alfred-Workflow update mechanism that would lead to it installing Alfred-3-only workflows in Alfred 2, thus breaking them. |
Use If no destination unit is given, the workflow will show conversions to all of the corresponding defaults. |
For example, for me I would like to have all currency converted by default, if no other target specified, to USD. For weight, I would like to see everything in grams, etc, etc.
The text was updated successfully, but these errors were encountered: