-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Move Settings deep link logic to Microsoft.PowerToys.Common.UI #13749
Conversation
@check-spelling-bot ReportUnrecognized words, please review:
Previously acknowledged words that are now absentAccessible available btn CIEXYZ coc CTriage dchristensen djsoref docsmsft dogancelik dupenv estdir Fody ftp ftps gmx htt ianjoneill inprivate installpowertoys itsme jakeoeding KERNELBASE listbox mfreadwrite mfuuid Nefario nitroin null nunit powertoyswiki PROGRAMFILES Radiobuttons sidepanel spamming systray ulazy windevbuildagents winstore xia XSmall xunitSome files were were automatically ignoredThese sample patterns would exclude them:
You should consider adding them to:
File matching is via Perl regular expressions. To check these files, more of their words need to be in the dictionary than not. You can use To accept these unrecognized words as correct (and remove the previously acknowledged and now absent words), run the following commands... in a clone of the [email protected]:microsoft/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.
|
{ | ||
public static class SettingsDeepLink | ||
{ | ||
public static void OpenSettings(string powerToysRelativePath, string module) |
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 don't think we should be providing path here, it is prone to errors. Also module should be probably enum not just a string
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.
path can be different, depending on modules' directory structure
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.
added enum
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.
yes, but this is an abstraction, modules should not care where are settings.exe stored and knowing the name of exe - from a module point I want to open settings for my module, I don't care where it is stored, what logic is used there. Exposing this information (path, module name) here breaks encapsulation and abstraction
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 agree. But as it is as simple as starting new process with path to .exe in the background, there's not much we can do here. I can remove first argument as both modules have same path to the exe at the moment, but as soon as some other module differs, this argument will be restored
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.
you should be able to do something much simpler. We define url launch protocol for PowerToys (defined during installation)
This allows us to launch PT by using its url protocol, which is "powertoys:"
So you should be able to do this:
Process.Start(new ProcessStartInfo("powertoys:--open-settings=ColorPicker") { UseShellExecute = true });
(arguments might need to be passed as a second parameter, not sure if this works)
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.
yeah, I'm having trouble passing the argument this way
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.
How does it even work? If I run "C:\Program Files\PowerToys\PowerToys.exe" "--open-settings=ColorPicker"
from a cmd it does not open that settings page
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.
Support for that is only in the master branch I believe. Not yet in shipping version.
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.
Using url protocol and passing argument only works if PT is not running at all. Argument is processed and specific settings page is opened. If PT is already running in the background (tray icon is there), and we only need to show Settings app, argument is being ignored. So, this doesn't work unfortunately
return "VideoConference"; | ||
default: | ||
{ | ||
return string.Empty; |
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.
on empty string, default settings window (Overview) will be opened. no need for panic here
@stefansjfw can we get this merged? I need it for ImageResizer :) |
yes. I'll continue trying to make it work with PT url protocol |
Summary of the Pull Request
What is this about:
What is include in the PR:
How does someone test / validate:
Quality Checklist
Contributor License Agreement (CLA)
A CLA must be signed. If not, go over here and sign the CLA.