-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[PT Run][New Plugin] Unit Converter #9800
[PT Run][New Plugin] Unit Converter #9800
Conversation
New misspellings found, please review:
To accept these changes, run the following commands
|
This is missing the WSX adjustments no matter what for installer |
New misspellings found, please review:
To accept these changes, run the following commands
|
1 similar comment
New misspellings found, please review:
To accept these changes, run the following commands
|
@ThiefZero |
Working on it. Added the interface members but breaks on not having the |
bf31995
to
5b99a38
Compare
New misspellings found, please review:
To accept these changes, run the following commands
|
5b99a38
to
fae61e1
Compare
@ThiefZero
|
Would it be possible to have it also work for "to" as well as "in"; eg "10 m/s to km/h"? |
fae61e1
to
3ec1190
Compare
@ThiefZero |
Hi! Yes, I'd like some feedback on the PR. Not sure if the feature is implemented OK and if I'm missing anything. If it's OK then maybe I can add some tests later (don't know how yet). |
@ThiefZero |
@ThiefZero |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions and questions.
<value>Provides unit conversion.</value> | ||
</data> | ||
<data name="wox_plugin_unitconverter_plugin_name" xml:space="preserve"> | ||
<value>UnitConverter</value> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<value>UnitConverter</value> | |
<value>Unit Converter</value> |
<resheader name="writer"> | ||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | ||
</resheader> | ||
<data name="wox_plugin_unitconverter_plugin_description" xml:space="preserve"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why Wox
is used here and at the other entries?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept the naming scheme found in the calculator
plugin. Doesn't seem to matter, consider it removed 👍
"Author": "ThiefZero", | ||
"Version": "0.0.1", | ||
"Language": "csharp", | ||
"Website": "https://github.com/ThiefZero/PowerToys", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think this must be the Microsoft/PowerToys
repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd put this as https://github.com/ThiefZero
"ID": "aa0ee9daff654fb7be452c2d77c471b9", | ||
"ActionKeyword": "*", | ||
"IsGlobal": true, | ||
"Name": "UnitConverter", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Name": "UnitConverter", | |
"Name": "Unit Converter", |
Most importantly getting the culture right (for use of |
3ec1190
to
46e018f
Compare
Should be good to go now. Only missing a custom icon. |
I think the 'Unit' icon is applicable for this converter. Here are the dark and light images (with the right dimensions) for that (the dark icon is there, just not visible because it's white-on-white :)): |
@ThiefZero
|
@check-spelling-bot ReportUnrecognized words, please review:
Previously acknowledged words that are now absentapos bc bh Chris's classmethod cls cn cx cz df dw EB ev fd fody fx getmembers gh hc hh hk hu ip ismethod jp Kf lambson laute loadingbar messagebox NX pb Pn pv pw px QI rpc ru rv rx sz tadele td tt tw Tz ul unitconvert uv vh vk vm vw Vx xa XY yy Zc zh zmTo accept these unrecognized words as correct (and remove the previously acknowledged and now absent words), run the following commands... in a clone of the git@github.com:ThiefZero/PowerToys.git repository
If you see a bunch of garbageIf it relates to a ... well-formed patternSee if there's a pattern that would match it. If not, try writing one and adding it to the Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines. Note that patterns can't match multiline strings. binary-ish stringPlease add a file path to the File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.
|
Nice catch, I added this in my local build and build the release version, then the release version of the installer. I installed (after clearing PowerToys folder from
Any thoughts on how to debug it? |
@ThiefZero |
@enricogior , @ThiefZero And can we catch it with the "Something went wrong ux"? Can we do some improvements here in a second step? |
I just rebuild the Master branch on release and the installer on release as well to test, still can't get I don't think this has anything to do with the |
Did you run something in an other user context? There is a bug regarding settings.json of pt run. |
That was it, apparently had to uncheck run as admin in the |
This persist after deleting the exe file too. We have an open issue on this bug. I`ll link to this comments. |
@ThiefZero |
@check-spelling-bot ReportUnrecognized words, please review:
Previously acknowledged words that are now absentapos autoupdate bc bh Chris's classmethod cls CMDARG cn cx cz deque df dw EB ev fd fody fx getmembers gh hc hh hk hu ip ismethod jp Kf lambson laute loadingbar messagebox multithreading nonwin NX overlaywindow pb Pn pv pw px QI rpc ru rv rx Shortcutguide sz tadele td tt tw Tz ul unitconvert uv vh vk vm vw Vx wostringstream xa XY yy Zc zh zipfolder zmTo accept these unrecognized words as correct (and remove the previously acknowledged and now absent words), run the following commands... in a clone of the git@github.com:ThiefZero/PowerToys.git repository
If you see a bunch of garbageIf it relates to a ... well-formed patternSee if there's a pattern that would match it. If not, try writing one and adding it to the Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines. Note that patterns can't match multiline strings. binary-ish stringPlease add a file path to the File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.
|
* [wip] add unit converter plugin * Plugin loads and accepts queries * Update csproj, add UnitConversion package, WIP * Switch unit conversion packages, add first convert logic * Move unitconverter to correct solution * Unitconversion supports double unabbreviated unitnames * Units convert with 1 abbreviation and 1 unabbreviated * Feature: make shorthand feet/inch notation work * Update to new naming scheme * Rename to community * Shorthand ft/in notation supports decimals. * Update plugin.json * Fix decimal/cultureInfo issue * Update plugin.json * Add degree prefixer function * Add unitConverter to wxs installer * Add name/description for interface * Add english translation, separate input parsing functions * Add words to spell-check * Add result rounding * PR feedback (rename stuff) * Unit conversion takes culture into account * Add InputInterpreter tests, small cleanup * Split conversion logic, add integration tests * Fix improper resource property names * [UnitConverter] Add image from niels9001. Fix exception error. Add function summaries. * [UnitConverter] Update image in installer * [UnitConverter] Support inputs without space (eg. 1cm to mm) * [UnitConverter] Add doc. Add more units. Update test packages. * [UnitConverter] Fix bug, regular unit conversion AND kB kb capital differences are recognized and work * [UnitConverter] Add doc img, fix spelling * [UnitConverter] Add byte capital test, just in case * [UnitConverter] Add unit tests to pipeline test build step * [UnitConverter] Change test to x64 from Any CPU. Fix issue where conversion to feet did not use cultureInfo. * [UnitConverter] Fix build config * removing allcpu forcing this to be global correcting depencies on launcher * [UnitConverter] Fix bug in degree conversion. Add unit to display result. Fix rounding display/value mismatch. * [UnitConverter] Improve test * [UnitConverter] Add Stylecop package, fix formatting, add GlobalSuppressions.cs * [UnitConverter] Change actionkeyword, more formatting * [UnitConverter] Add context menu to conversion results * [UnitConverter] Disable global * [UnitConverter] Add UnitsNet.dll to installer, insert example in description Co-authored-by: Clint Rutkas <clint@rutkas.com> Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com>
* [wip] add unit converter plugin * Plugin loads and accepts queries * Update csproj, add UnitConversion package, WIP * Switch unit conversion packages, add first convert logic * Move unitconverter to correct solution * Unitconversion supports double unabbreviated unitnames * Units convert with 1 abbreviation and 1 unabbreviated * Feature: make shorthand feet/inch notation work * Update to new naming scheme * Rename to community * Shorthand ft/in notation supports decimals. * Update plugin.json * Fix decimal/cultureInfo issue * Update plugin.json * Add degree prefixer function * Add unitConverter to wxs installer * Add name/description for interface * Add english translation, separate input parsing functions * Add words to spell-check * Add result rounding * PR feedback (rename stuff) * Unit conversion takes culture into account * Add InputInterpreter tests, small cleanup * Split conversion logic, add integration tests * Fix improper resource property names * [UnitConverter] Add image from niels9001. Fix exception error. Add function summaries. * [UnitConverter] Update image in installer * [UnitConverter] Support inputs without space (eg. 1cm to mm) * [UnitConverter] Add doc. Add more units. Update test packages. * [UnitConverter] Fix bug, regular unit conversion AND kB kb capital differences are recognized and work * [UnitConverter] Add doc img, fix spelling * [UnitConverter] Add byte capital test, just in case * [UnitConverter] Add unit tests to pipeline test build step * [UnitConverter] Change test to x64 from Any CPU. Fix issue where conversion to feet did not use cultureInfo. * [UnitConverter] Fix build config * removing allcpu forcing this to be global correcting depencies on launcher * [UnitConverter] Fix bug in degree conversion. Add unit to display result. Fix rounding display/value mismatch. * [UnitConverter] Improve test * [UnitConverter] Add Stylecop package, fix formatting, add GlobalSuppressions.cs * [UnitConverter] Change actionkeyword, more formatting * [UnitConverter] Add context menu to conversion results * [UnitConverter] Disable global * [UnitConverter] Add UnitsNet.dll to installer, insert example in description Co-authored-by: Clint Rutkas <clint@rutkas.com> Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com>
* [wip] add unit converter plugin * Plugin loads and accepts queries * Update csproj, add UnitConversion package, WIP * Switch unit conversion packages, add first convert logic * Move unitconverter to correct solution * Unitconversion supports double unabbreviated unitnames * Units convert with 1 abbreviation and 1 unabbreviated * Feature: make shorthand feet/inch notation work * Update to new naming scheme * Rename to community * Shorthand ft/in notation supports decimals. * Update plugin.json * Fix decimal/cultureInfo issue * Update plugin.json * Add degree prefixer function * Add unitConverter to wxs installer * Add name/description for interface * Add english translation, separate input parsing functions * Add words to spell-check * Add result rounding * PR feedback (rename stuff) * Unit conversion takes culture into account * Add InputInterpreter tests, small cleanup * Split conversion logic, add integration tests * Fix improper resource property names * [UnitConverter] Add image from niels9001. Fix exception error. Add function summaries. * [UnitConverter] Update image in installer * [UnitConverter] Support inputs without space (eg. 1cm to mm) * [UnitConverter] Add doc. Add more units. Update test packages. * [UnitConverter] Fix bug, regular unit conversion AND kB kb capital differences are recognized and work * [UnitConverter] Add doc img, fix spelling * [UnitConverter] Add byte capital test, just in case * [UnitConverter] Add unit tests to pipeline test build step * [UnitConverter] Change test to x64 from Any CPU. Fix issue where conversion to feet did not use cultureInfo. * [UnitConverter] Fix build config * removing allcpu forcing this to be global correcting depencies on launcher * [UnitConverter] Fix bug in degree conversion. Add unit to display result. Fix rounding display/value mismatch. * [UnitConverter] Improve test * [UnitConverter] Add Stylecop package, fix formatting, add GlobalSuppressions.cs * [UnitConverter] Change actionkeyword, more formatting * [UnitConverter] Add context menu to conversion results * [UnitConverter] Disable global * [UnitConverter] Add UnitsNet.dll to installer, insert example in description Co-authored-by: Clint Rutkas <clint@rutkas.com> Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com>
* [wip] add unit converter plugin * Plugin loads and accepts queries * Update csproj, add UnitConversion package, WIP * Switch unit conversion packages, add first convert logic * Move unitconverter to correct solution * Unitconversion supports double unabbreviated unitnames * Units convert with 1 abbreviation and 1 unabbreviated * Feature: make shorthand feet/inch notation work * Update to new naming scheme * Rename to community * Shorthand ft/in notation supports decimals. * Update plugin.json * Fix decimal/cultureInfo issue * Update plugin.json * Add degree prefixer function * Add unitConverter to wxs installer * Add name/description for interface * Add english translation, separate input parsing functions * Add words to spell-check * Add result rounding * PR feedback (rename stuff) * Unit conversion takes culture into account * Add InputInterpreter tests, small cleanup * Split conversion logic, add integration tests * Fix improper resource property names * [UnitConverter] Add image from niels9001. Fix exception error. Add function summaries. * [UnitConverter] Update image in installer * [UnitConverter] Support inputs without space (eg. 1cm to mm) * [UnitConverter] Add doc. Add more units. Update test packages. * [UnitConverter] Fix bug, regular unit conversion AND kB kb capital differences are recognized and work * [UnitConverter] Add doc img, fix spelling * [UnitConverter] Add byte capital test, just in case * [UnitConverter] Add unit tests to pipeline test build step * [UnitConverter] Change test to x64 from Any CPU. Fix issue where conversion to feet did not use cultureInfo. * [UnitConverter] Fix build config * removing allcpu forcing this to be global correcting depencies on launcher * [UnitConverter] Fix bug in degree conversion. Add unit to display result. Fix rounding display/value mismatch. * [UnitConverter] Improve test * [UnitConverter] Add Stylecop package, fix formatting, add GlobalSuppressions.cs * [UnitConverter] Change actionkeyword, more formatting * [UnitConverter] Add context menu to conversion results * [UnitConverter] Disable global * [UnitConverter] Add UnitsNet.dll to installer, insert example in description Co-authored-by: Clint Rutkas <clint@rutkas.com> Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com>
* [wip] add unit converter plugin * Plugin loads and accepts queries * Update csproj, add UnitConversion package, WIP * Switch unit conversion packages, add first convert logic * Move unitconverter to correct solution * Unitconversion supports double unabbreviated unitnames * Units convert with 1 abbreviation and 1 unabbreviated * Feature: make shorthand feet/inch notation work * Update to new naming scheme * Rename to community * Shorthand ft/in notation supports decimals. * Update plugin.json * Fix decimal/cultureInfo issue * Update plugin.json * Add degree prefixer function * Add unitConverter to wxs installer * Add name/description for interface * Add english translation, separate input parsing functions * Add words to spell-check * Add result rounding * PR feedback (rename stuff) * Unit conversion takes culture into account * Add InputInterpreter tests, small cleanup * Split conversion logic, add integration tests * Fix improper resource property names * [UnitConverter] Add image from niels9001. Fix exception error. Add function summaries. * [UnitConverter] Update image in installer * [UnitConverter] Support inputs without space (eg. 1cm to mm) * [UnitConverter] Add doc. Add more units. Update test packages. * [UnitConverter] Fix bug, regular unit conversion AND kB kb capital differences are recognized and work * [UnitConverter] Add doc img, fix spelling * [UnitConverter] Add byte capital test, just in case * [UnitConverter] Add unit tests to pipeline test build step * [UnitConverter] Change test to x64 from Any CPU. Fix issue where conversion to feet did not use cultureInfo. * [UnitConverter] Fix build config * removing allcpu forcing this to be global correcting depencies on launcher * [UnitConverter] Fix bug in degree conversion. Add unit to display result. Fix rounding display/value mismatch. * [UnitConverter] Improve test * [UnitConverter] Add Stylecop package, fix formatting, add GlobalSuppressions.cs * [UnitConverter] Change actionkeyword, more formatting * [UnitConverter] Add context menu to conversion results * [UnitConverter] Disable global * [UnitConverter] Add UnitsNet.dll to installer, insert example in description Co-authored-by: Clint Rutkas <clint@rutkas.com> Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com>
* [wip] add unit converter plugin * Plugin loads and accepts queries * Update csproj, add UnitConversion package, WIP * Switch unit conversion packages, add first convert logic * Move unitconverter to correct solution * Unitconversion supports double unabbreviated unitnames * Units convert with 1 abbreviation and 1 unabbreviated * Feature: make shorthand feet/inch notation work * Update to new naming scheme * Rename to community * Shorthand ft/in notation supports decimals. * Update plugin.json * Fix decimal/cultureInfo issue * Update plugin.json * Add degree prefixer function * Add unitConverter to wxs installer * Add name/description for interface * Add english translation, separate input parsing functions * Add words to spell-check * Add result rounding * PR feedback (rename stuff) * Unit conversion takes culture into account * Add InputInterpreter tests, small cleanup * Split conversion logic, add integration tests * Fix improper resource property names * [UnitConverter] Add image from niels9001. Fix exception error. Add function summaries. * [UnitConverter] Update image in installer * [UnitConverter] Support inputs without space (eg. 1cm to mm) * [UnitConverter] Add doc. Add more units. Update test packages. * [UnitConverter] Fix bug, regular unit conversion AND kB kb capital differences are recognized and work * [UnitConverter] Add doc img, fix spelling * [UnitConverter] Add byte capital test, just in case * [UnitConverter] Add unit tests to pipeline test build step * [UnitConverter] Change test to x64 from Any CPU. Fix issue where conversion to feet did not use cultureInfo. * [UnitConverter] Fix build config * removing allcpu forcing this to be global correcting depencies on launcher * [UnitConverter] Fix bug in degree conversion. Add unit to display result. Fix rounding display/value mismatch. * [UnitConverter] Improve test * [UnitConverter] Add Stylecop package, fix formatting, add GlobalSuppressions.cs * [UnitConverter] Change actionkeyword, more formatting * [UnitConverter] Add context menu to conversion results * [UnitConverter] Disable global * [UnitConverter] Add UnitsNet.dll to installer, insert example in description Co-authored-by: Clint Rutkas <clint@rutkas.com> Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com>
Summary of the Pull Request
What is this about:
A unit converter plugin for PowerToys.Run. I've had this idea for a while now and wanted to see if I could contribute to my first open source project. (I hadn't opened an issue yet because I wanted to see if I could make it work.)
As it's my first open source contribution constructive feedback is appreciated ✌️.
I'm using a package called UnitsNet to do these conversions.
What is included in the PR:
Currently Supported Units (13)
How does someone test / validate:
Manually, or running the unit tests.
Possible Improvements
Support multiple length input such as '1 foot 5 inch in cm'. (?)Quality Checklist
Contributor License Agreement (CLA)
A CLA must be signed. If not, go over here and sign the CLA.