Skip to content

Commit

Permalink
Fix: Profile toggle button if profile file is locked (#1991)
Browse files Browse the repository at this point in the history
* Fix: Profile toggle button if profile file is locked

* Docs: Add #1991
  • Loading branch information
BornToBeRoot authored Mar 5, 2023
1 parent 5a994f1 commit 687e0f7
Show file tree
Hide file tree
Showing 15 changed files with 519 additions and 42 deletions.
40 changes: 37 additions & 3 deletions Source/NETworkManager/Views/AWSSessionManagerHostView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -506,9 +506,43 @@
</Button>
</Grid>
</Grid>
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType= {x:Type mah:MetroWindow}}, Path=DataContext.IsProfileFileLocked, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}">
<TextBlock Text="{x:Static localization:Strings.UnlockTheProfileFileMessage}" Style="{StaticResource MessageTextBlock}" Margin="0,0,0,10" />
</StackPanel>
<Grid Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType= {x:Type mah:MetroWindow}}, Path=DataContext.IsProfileFileLocked, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}">
<Grid.RowDefinitions>
<!-- Adjust the Height without Textbox -->
<RowDefinition Height="27" />
<RowDefinition Height="10" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ToggleButton Grid.Row="0" IsChecked="{Binding ExpandProfileView}" HorizontalAlignment="Left">
<ToggleButton.Style>
<Style TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource MahApps.Styles.Button.Circle}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" RecognizesAccessKey="True" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ToggleButton.Style>
<Rectangle Width="16" Height="16">
<Rectangle.OpacityMask>
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=ChevronRight}" />
</Rectangle.OpacityMask>
<Rectangle.Style>
<Style TargetType="{x:Type Rectangle}">
<Setter Property="Fill" Value="{DynamicResource MahApps.Brushes.Gray3}" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Fill" Value="{DynamicResource MahApps.Brushes.Gray5}" />
</Trigger>
</Style.Triggers>
</Style>
</Rectangle.Style>
</Rectangle>
</ToggleButton>
<TextBlock Grid.Row="2" Text="{x:Static localization:Strings.UnlockTheProfileFileMessage}" Style="{StaticResource MessageTextBlock}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,10" />
</Grid>
</Grid>
</Expander>
</Grid>
Expand Down
40 changes: 37 additions & 3 deletions Source/NETworkManager/Views/DNSLookupHostView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,43 @@
</Button>
</Grid>
</Grid>
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType= {x:Type mah:MetroWindow}}, Path=DataContext.IsProfileFileLocked, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}">
<TextBlock Text="{x:Static localization:Strings.UnlockTheProfileFileMessage}" Style="{StaticResource MessageTextBlock}" Margin="0,0,0,10" />
</StackPanel>
<Grid Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType= {x:Type mah:MetroWindow}}, Path=DataContext.IsProfileFileLocked, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}">
<Grid.RowDefinitions>
<!-- Adjust the Height without Textbox -->
<RowDefinition Height="27" />
<RowDefinition Height="10" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ToggleButton Grid.Row="0" IsChecked="{Binding ExpandProfileView}" HorizontalAlignment="Left">
<ToggleButton.Style>
<Style TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource MahApps.Styles.Button.Circle}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" RecognizesAccessKey="True" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ToggleButton.Style>
<Rectangle Width="16" Height="16">
<Rectangle.OpacityMask>
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=ChevronRight}" />
</Rectangle.OpacityMask>
<Rectangle.Style>
<Style TargetType="{x:Type Rectangle}">
<Setter Property="Fill" Value="{DynamicResource MahApps.Brushes.Gray3}" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Fill" Value="{DynamicResource MahApps.Brushes.Gray5}" />
</Trigger>
</Style.Triggers>
</Style>
</Rectangle.Style>
</Rectangle>
</ToggleButton>
<TextBlock Grid.Row="2" Text="{x:Static localization:Strings.UnlockTheProfileFileMessage}" Style="{StaticResource MessageTextBlock}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,10" />
</Grid>
</Grid>
</Expander>
</Grid>
Expand Down
40 changes: 37 additions & 3 deletions Source/NETworkManager/Views/IPScannerHostView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,43 @@
</Button>
</Grid>
</Grid>
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType= {x:Type mah:MetroWindow}}, Path=DataContext.IsProfileFileLocked, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}">
<TextBlock Text="{x:Static localization:Strings.UnlockTheProfileFileMessage}" Style="{StaticResource MessageTextBlock}" Margin="0,0,0,10" />
</StackPanel>
<Grid Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType= {x:Type mah:MetroWindow}}, Path=DataContext.IsProfileFileLocked, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}">
<Grid.RowDefinitions>
<!-- Adjust the Height without Textbox -->
<RowDefinition Height="27" />
<RowDefinition Height="10" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ToggleButton Grid.Row="0" IsChecked="{Binding ExpandProfileView}" HorizontalAlignment="Left">
<ToggleButton.Style>
<Style TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource MahApps.Styles.Button.Circle}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" RecognizesAccessKey="True" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ToggleButton.Style>
<Rectangle Width="16" Height="16">
<Rectangle.OpacityMask>
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=ChevronRight}" />
</Rectangle.OpacityMask>
<Rectangle.Style>
<Style TargetType="{x:Type Rectangle}">
<Setter Property="Fill" Value="{DynamicResource MahApps.Brushes.Gray3}" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Fill" Value="{DynamicResource MahApps.Brushes.Gray5}" />
</Trigger>
</Style.Triggers>
</Style>
</Rectangle.Style>
</Rectangle>
</ToggleButton>
<TextBlock Grid.Row="2" Text="{x:Static localization:Strings.UnlockTheProfileFileMessage}" Style="{StaticResource MessageTextBlock}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,10" />
</Grid>
</Grid>
</Expander>
</Grid>
Expand Down
40 changes: 37 additions & 3 deletions Source/NETworkManager/Views/NetworkInterfaceView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1048,9 +1048,43 @@
</Button>
</Grid>
</Grid>
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType= {x:Type mah:MetroWindow}}, Path=DataContext.IsProfileFileLocked, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}">
<TextBlock Text="{x:Static localization:Strings.UnlockTheProfileFileMessage}" Style="{StaticResource MessageTextBlock}" Margin="0,0,0,10" />
</StackPanel>
<Grid Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType= {x:Type mah:MetroWindow}}, Path=DataContext.IsProfileFileLocked, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}">
<Grid.RowDefinitions>
<!-- Adjust the Height without Textbox -->
<RowDefinition Height="27" />
<RowDefinition Height="10" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ToggleButton Grid.Row="0" IsChecked="{Binding ExpandProfileView}" HorizontalAlignment="Left">
<ToggleButton.Style>
<Style TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource MahApps.Styles.Button.Circle}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" RecognizesAccessKey="True" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ToggleButton.Style>
<Rectangle Width="16" Height="16">
<Rectangle.OpacityMask>
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=ChevronRight}" />
</Rectangle.OpacityMask>
<Rectangle.Style>
<Style TargetType="{x:Type Rectangle}">
<Setter Property="Fill" Value="{DynamicResource MahApps.Brushes.Gray3}" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Fill" Value="{DynamicResource MahApps.Brushes.Gray5}" />
</Trigger>
</Style.Triggers>
</Style>
</Rectangle.Style>
</Rectangle>
</ToggleButton>
<TextBlock Grid.Row="2" Text="{x:Static localization:Strings.UnlockTheProfileFileMessage}" Style="{StaticResource MessageTextBlock}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,10" />
</Grid>
</Grid>
</Expander>
</Grid>
Expand Down
40 changes: 37 additions & 3 deletions Source/NETworkManager/Views/PingMonitorHostView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,43 @@
</Button>
</Grid>
</Grid>
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType= {x:Type mah:MetroWindow}}, Path=DataContext.IsProfileFileLocked, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}">
<TextBlock Text="{x:Static localization:Strings.UnlockTheProfileFileMessage}" Style="{StaticResource MessageTextBlock}" Margin="0,0,0,10" />
</StackPanel>
<Grid Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType= {x:Type mah:MetroWindow}}, Path=DataContext.IsProfileFileLocked, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}">
<Grid.RowDefinitions>
<!-- Adjust the Height without Textbox -->
<RowDefinition Height="27" />
<RowDefinition Height="10" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ToggleButton Grid.Row="0" IsChecked="{Binding ExpandProfileView}" HorizontalAlignment="Left">
<ToggleButton.Style>
<Style TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource MahApps.Styles.Button.Circle}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" RecognizesAccessKey="True" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ToggleButton.Style>
<Rectangle Width="16" Height="16">
<Rectangle.OpacityMask>
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=ChevronRight}" />
</Rectangle.OpacityMask>
<Rectangle.Style>
<Style TargetType="{x:Type Rectangle}">
<Setter Property="Fill" Value="{DynamicResource MahApps.Brushes.Gray3}" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Fill" Value="{DynamicResource MahApps.Brushes.Gray5}" />
</Trigger>
</Style.Triggers>
</Style>
</Rectangle.Style>
</Rectangle>
</ToggleButton>
<TextBlock Grid.Row="2" Text="{x:Static localization:Strings.UnlockTheProfileFileMessage}" Style="{StaticResource MessageTextBlock}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,10" />
</Grid>
</Grid>
</Expander>
</Grid>
Expand Down
Loading

0 comments on commit 687e0f7

Please sign in to comment.