mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 12:46:47 +02:00
[Hosts]Add learn more link to warning dialog (#39946)
## Summary of the Pull Request Adds a *Learn more* link pointing [here](https://aka.ms/PowerToysOverview_HostsFileEditor) (the same as in the settings) to the warning dialog that shows up when Hosts File Editor starts ## PR Checklist - [x] **Closes:** #39859 - [ ] **Communication:** I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected - [ ] **Tests:** Added/updated and all pass - [x] **Localization:** All end user facing strings can be localized - [x] **Dev docs:** No need - [x] **New binaries:** None - [x] **Documentation updated:** No need ## Detailed Description of the Pull Request / Additional comments  <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed Tested the UI manually
This commit is contained in:
@@ -139,10 +139,23 @@ namespace HostsUILib.Views
|
|||||||
dialog.XamlRoot = XamlRoot;
|
dialog.XamlRoot = XamlRoot;
|
||||||
dialog.Style = Application.Current.Resources["DefaultContentDialogStyle"] as Style;
|
dialog.Style = Application.Current.Resources["DefaultContentDialogStyle"] as Style;
|
||||||
dialog.Title = resourceLoader.GetString("WarningDialog_Title");
|
dialog.Title = resourceLoader.GetString("WarningDialog_Title");
|
||||||
dialog.Content = new TextBlock
|
dialog.Content = new StackPanel
|
||||||
{
|
{
|
||||||
Text = resourceLoader.GetString("WarningDialog_Text"),
|
Children =
|
||||||
TextWrapping = TextWrapping.Wrap,
|
{
|
||||||
|
new TextBlock
|
||||||
|
{
|
||||||
|
Text = resourceLoader.GetString("WarningDialog_Text"),
|
||||||
|
TextWrapping = TextWrapping.Wrap,
|
||||||
|
},
|
||||||
|
new HyperlinkButton
|
||||||
|
{
|
||||||
|
Content = resourceLoader.GetString("WarningDialog_LearnMore"),
|
||||||
|
NavigateUri = new Uri("https://aka.ms/PowerToysOverview_HostsFileEditor"),
|
||||||
|
Padding = new Thickness(0),
|
||||||
|
Margin = new Thickness(0, 5, 0, 5),
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
dialog.PrimaryButtonText = resourceLoader.GetString("WarningDialog_AcceptBtn");
|
dialog.PrimaryButtonText = resourceLoader.GetString("WarningDialog_AcceptBtn");
|
||||||
dialog.PrimaryButtonStyle = Application.Current.Resources["AccentButtonStyle"] as Style;
|
dialog.PrimaryButtonStyle = Application.Current.Resources["AccentButtonStyle"] as Style;
|
||||||
|
|||||||
@@ -331,6 +331,9 @@
|
|||||||
<data name="WarningDialog_Title" xml:space="preserve">
|
<data name="WarningDialog_Title" xml:space="preserve">
|
||||||
<value>Warning</value>
|
<value>Warning</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="WarningDialog_LearnMore" xml:space="preserve">
|
||||||
|
<value>Learn more</value>
|
||||||
|
</data>
|
||||||
<data name="WindowAdminTitle" xml:space="preserve">
|
<data name="WindowAdminTitle" xml:space="preserve">
|
||||||
<value>Administrator: Hosts File Editor</value>
|
<value>Administrator: Hosts File Editor</value>
|
||||||
<comment>Title of the window when running as administrator. "Hosts File Editor" is the name of the utility. "Hosts" refers to the system hosts file, do not loc</comment>
|
<comment>Title of the window when running as administrator. "Hosts File Editor" is the name of the utility. "Hosts" refers to the system hosts file, do not loc</comment>
|
||||||
|
|||||||
Reference in New Issue
Block a user