Skip to content

Commit 023e688

Browse files
authored
Disable connect button if host is not valid (#1389)
1 parent b34c3d0 commit 023e688

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

Source/NETworkManager/Views/PowerShellConnectDialog.xaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,24 @@
5353
<ComboBox x:Name="ComboBoxTypes" Grid.Column="2" Grid.Row="6" ItemsSource="{Binding ExecutionPolicies}" SelectedItem="{Binding ExecutionPolicy}" />
5454
</Grid>
5555
<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right">
56-
<Button Content="{x:Static localization:Strings.Connect}" Command="{Binding ConnectCommand}" IsDefault="True" Style="{StaticResource HighlightedButton}" Margin="0,0,10,0" />
56+
<Button Content="{x:Static localization:Strings.Connect}" Command="{Binding ConnectCommand}" IsDefault="True" Margin="0,0,10,0">
57+
<Button.Style>
58+
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource HighlightedButton}">
59+
<Setter Property="IsEnabled" Value="True" />
60+
<Style.Triggers>
61+
<MultiDataTrigger>
62+
<MultiDataTrigger.Conditions>
63+
<Condition Binding="{Binding EnableRemoteConsole}" Value="True" />
64+
<Condition Binding="{Binding Path=(Validation.HasError), ElementName=ComboBoxHost}" Value="True" />
65+
</MultiDataTrigger.Conditions>
66+
<MultiDataTrigger.Setters>
67+
<Setter Property="IsEnabled" Value="False" />
68+
</MultiDataTrigger.Setters>
69+
</MultiDataTrigger>
70+
</Style.Triggers>
71+
</Style>
72+
</Button.Style>
73+
</Button>
5774
<Button Content="{x:Static localization:Strings.Cancel}" Command="{Binding CancelCommand}" IsCancel="True" Style="{StaticResource DefaultButton}" />
5875
</StackPanel>
5976
</Grid>

docs/Changelog/next-release.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ permalink: /Changelog/next-release
4949
- Language `zh-CN` and `zh-TW` is missing in dotnet publish. Build script changed from `dotnet` to `msbuild` [#1316](https://github.com/BornToBeRoot/NETworkManager/issues/1316){:target="_blank"}
5050
- Remote Desktop
5151
- Connection via Profile leads to error message "Error Code 4 (Total login limit was reached)" fixed [#1265](https://github.com/BornToBeRoot/NETworkManager/issues/1265){:target="_blank"}
52+
- PowerShell
53+
- Validate host input in connect dialog [#1373](https://github.com/BornToBeRoot/NETworkManager/issues/1373){:target="_blank"}
5254
- PuTTY
5355
- Fixed that some arguments from the connect dialog of PuTTY (like privatekey) were not applied correctly. Fix was also applied to remote desktop, powershell, tigervnc and webconsole, even if the bug could not be reproduced there. [#1372](https://github.com/BornToBeRoot/NETworkManager/issues/1372){:target="_blank"}
5456

0 commit comments

Comments
 (0)