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] Helper for Execute Shells Process Calls #9538
Conversation
src/modules/launcher/Plugins/Microsoft.Plugin.Program/Programs/Win32Program.cs
Outdated
Show resolved
Hide resolved
Log.Exception($"Unable to launch Windows Search Settings: {ex.Message}", ex, GetType()); | ||
} | ||
|
||
Helper.OpenInShell("ms-settings:cortana-windowssearch"); |
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.
In some cases the returned value of Helper.OpenInShell
is not checked and no error is shown.
I haven't check all the places where this is done, consider verifying why is not done and in case add a comment motivating why the error is not shown to the user.
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 plugins are checking the result and display a MessageBox.
Should we always display it in case of error? We can consider move the MessageBox inside Helper.OpenInShell
.
@davidegiacometti |
@davidegiacometti |
src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/ShellAction.cs
Show resolved
Hide resolved
Yes, It was already possible but in Program and Indexer plugin are invoking |
@@ -71,6 +71,7 @@ | |||
|
|||
<ItemGroup> | |||
<ProjectReference Include="..\..\Wox.Plugin\Wox.Plugin.csproj" /> | |||
<ProjectReference Include="..\..\Wox.Infrastructure\Wox.Infrastructure.csproj" /> |
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.
Something to ponder about. It feels like plugins should be independent and reference to Wox.Infrastructure violates it. It is okay to have reference to a project that contains plugin interface. What do you think? Does it make sense?
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.
Oh.. I missed this! Almost all plugin are referencing Wox.Infrastructure
. Consider also that ISavable
and PluginJsonStorage
are in Wox.Infrastructure
. Could be a refactoring. Should I open an issue?
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.
We can open a separate issue for that and discuss the pros and cons there. It is definitely a low-priority one.
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.
LGTM!
List of places where result isn't checked and user isn't notified in case of error:
@enricogior any thoughts on this? I think that URI and Program should display a message in case of error. |
What about creating a unified ui (I suggest toast notification) for error/additional info messages by creating a new common helper class for info and error messages? Possible messages:
|
@davidegiacometti @htcfreek |
Then we should fix the bug that warning messages like DriveIndexWarning aren't shown as first result. (Don't know the issue at the moment.) |
We should be fine with dialogs at the moment. |
I let you make the call since you have a better understanding of the code. |
a695a9a
to
650ce11
Compare
@enricogior PR is ready for review. |
Summary of the Pull Request
What is this about:
Common helper for execute shell across PT Run plugins.
What is include in the PR:
Removed most of the
Process.Start
used for invoking shell across PT Run plugins.Still have 2 hardcorded
explorer.exe
in folder and indexer plugin used to focus the file when explorer is opened #7339 (comment)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.