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

[Run] Improve error MessageBox #34564

Merged
merged 3 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/modules/launcher/PowerLauncher/Plugin/PluginManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public static void InitializePlugins(IPublicAPI api)
if (!failedPlugins.IsEmpty)
{
var failed = string.Join(",", failedPlugins.Select(x => x.Metadata.Name));
davidegiacometti marked this conversation as resolved.
Show resolved Hide resolved
var description = string.Format(CultureInfo.CurrentCulture, FailedToInitializePluginsDescription, failed);
var description = $"{string.Format(CultureInfo.CurrentCulture, FailedToInitializePluginsDescription, failed)}\n\n{Resources.FailedToInitializePluginsDescriptionPartTwo}";
Application.Current.Dispatcher.InvokeAsync(() => API.ShowMsg(Resources.FailedToInitializePluginsTitle, description, string.Empty, false));
}
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions src/modules/launcher/PowerLauncher/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,24 @@
<value>Settings will be reset to default and program will continue to function.</value>
</data>
<data name="FailedToInitializePluginsDescription" xml:space="preserve">
<value>Plugins: {0} - fail to load and would be disabled, please contact plugins creator for help</value>
<value>Fail to initialize plugins: {0}</value>
</data>
<data name="FailedToInitializePluginsTitle" xml:space="preserve">
<value>Fail to initialize plugins</value>
<value>PowerToys Run - Plugin Initialization Error</value>
<comment>Don't translate "PowerToys Run". This is a product name.</comment>
</data>
<data name="ContextMenuItemsAvailable" xml:space="preserve">
<value>Appended controls available</value>
</data>
<data name="PluginKeywords" xml:space="preserve">
<value>Plugin keywords</value>
</data>
<data name="RegisterHotkeyFailedTitle" xml:space="preserve">
<value>PowerToys Run - Hotkey Error</value>
<comment>Don't translate "PowerToys Run". This is a product name.</comment>
</data>
<data name="FailedToInitializePluginsDescriptionPartTwo" xml:space="preserve">
<value>Please report the bug to https://aka.ms/powerToysReportBug. (For third-party plugins, please contact the plugin author.)</value>
<comment>"https://aka.ms/powerToysReportBug" is a web uri.</comment>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ private void SetHotkey(IntPtr hwnd, HotkeyModel hotkeyModel, HotkeyCallback acti
catch (Exception)
{
string errorMsg = string.Format(CultureInfo.InvariantCulture, RegisterHotkeyFailed, hotkeyStr);
MessageBox.Show(errorMsg);
MessageBox.Show(errorMsg, Properties.Resources.RegisterHotkeyFailedTitle);
}
}

Expand Down
Loading