Skip to content

Commit

Permalink
Trusted locations edit path (#13109)
Browse files Browse the repository at this point in the history
  • Loading branch information
reddyashish authored Jul 14, 2022
1 parent b0694a9 commit a1eef6a
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/DynamoCoreWpf/DynamoCoreWpf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -1507,8 +1507,8 @@
<Resource Include="UI\Images\caret_down.png" />
<Resource Include="UI\Images\down-hover-16px.png" />
<Resource Include="UI\Images\down_16_16.png" />
<Resource Include="UI\Images\folder_16_16.png" />
<Resource Include="UI\Images\folder-hover-16px.png" />
<Resource Include="UI\Images\edit_folder_16px_default.png" />
<Resource Include="UI\Images\edit_folder_16px_hover.png" />
<Resource Include="UI\Images\up_16_16.png" />
<Resource Include="UI\Images\up-hover-16px.png" />
<Resource Include="UI\Images\link-16px.png" />
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/DynamoCoreWpf/UI/Themes/Modern/DynamoModern.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2875,17 +2875,17 @@
</Setter>
</Style>

<Style x:Key="FolderButtonStyle" TargetType="Button">
<Style x:Key="EditFolderButtonStyle" TargetType="Button">
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid>
<Image Name="folderIcon" Width="16" Height="16" Source="pack://application:,,,/DynamoCoreWpf;component/UI/Images/folder_16_16.png"/>
<Image Name="folderIcon" Width="16" Height="16" Source="pack://application:,,,/DynamoCoreWpf;component/UI/Images/edit_folder_16px_default.png"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="folderIcon" Property="Source" Value="pack://application:,,,/DynamoCoreWpf;component/UI/Images/folder-hover-16px.png" />
<Setter TargetName="folderIcon" Property="Source" Value="pack://application:,,,/DynamoCoreWpf;component/UI/Images/edit_folder_16px_hover.png" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value=".5" />
Expand Down
10 changes: 9 additions & 1 deletion src/DynamoCoreWpf/ViewModels/Menu/TrustedPathViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,22 @@ private void ShowFileDialog(TrustedPathEventArgs e)
e.Cancel = true;
}

private void ShowFileDialogUpdatePath(TrustedPathEventArgs e)
{
OnRequestShowFileDialog(this, e);

if (e.Cancel == false && TrustedLocations.Contains(e.Path))
e.Cancel = true;
}

private void UpdatePathAt(int index)
{
var args = new TrustedPathEventArgs
{
Path = TrustedLocations[index]
};

ShowFileDialog(args);
ShowFileDialogUpdatePath(args);

if (args.Cancel)
return;
Expand Down
2 changes: 1 addition & 1 deletion src/DynamoCoreWpf/Views/Menu/TrustedPathView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
CommandParameter="{Binding}"
ToolTipService.ShowOnDisabled="True"
Background="{StaticResource PreferencesWindowBackgroundColor}"
Style="{StaticResource FolderButtonStyle}">
Style="{StaticResource EditFolderButtonStyle}">
<Button.ToolTip>
<ToolTip Content="{x:Static p:Resources.PackagePathUpdatePathTooltip}" Style="{StaticResource GenericToolTipLight}"/>
</Button.ToolTip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
CommandParameter="{Binding}"
ToolTipService.ShowOnDisabled="True"
Background="{StaticResource PreferencesWindowBackgroundColor}"
Style="{StaticResource FolderButtonStyle}">
Style="{StaticResource EditFolderButtonStyle}">
<Button.ToolTip>
<ToolTip Content="{x:Static p:Resources.PackagePathUpdatePathTooltip}" Style="{StaticResource GenericToolTipLight}"/>
</Button.ToolTip>
Expand Down

0 comments on commit a1eef6a

Please sign in to comment.