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

Multiple fixes for 2.18 #13880

Merged
merged 8 commits into from
Apr 10, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions src/DynamoCore/Properties/Resources.Designer.cs

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

6 changes: 3 additions & 3 deletions src/DynamoCore/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -781,10 +781,10 @@ This package is loaded and ready to be used.</value>
This package has not been loaded because another conflicting package was loaded before it.</value>
</data>
<data name="GroupDefaultText" xml:space="preserve">
<value>&lt;Double click here to edit group description&gt;</value>
<value>Description &lt;Double click here to edit group description&gt;</value>
</data>
<data name="GroupNameDefaultText" xml:space="preserve">
<value>&lt;Double click here to edit group title&gt;</value>
<value>Title &lt;Double click here to edit group title&gt;</value>
</data>
<data name="OutputPortAlternativeName" xml:space="preserve">
<value>output</value>
Expand Down Expand Up @@ -902,4 +902,4 @@ This package likely contains an assembly that is blocked. You will need to load
<data name="DynamoLanguages_noxlate" xml:space="preserve">
<value>English,Čeština,Deutsch,Español,Français,Italiano,日本語,한국어,Polski,Português (Brasil),Русский,简体中文,繁體中文</value>
</data>
</root>
</root>
6 changes: 3 additions & 3 deletions src/DynamoCore/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -786,10 +786,10 @@ This package is loaded and ready to be used.</value>
This package has not been loaded because another conflicting package was loaded before it.</value>
</data>
<data name="GroupDefaultText" xml:space="preserve">
<value>&lt;Double click here to edit group description&gt;</value>
<value>Description &lt;Double click here to edit group description&gt;</value>
</data>
<data name="GroupNameDefaultText" xml:space="preserve">
<value>&lt;Double click here to edit group title&gt;</value>
<value>Title &lt;Double click here to edit group title&gt;</value>
</data>
<data name="NodeInformationalStateShowAllErrors" xml:space="preserve">
<value>Show all errors</value>
Expand Down Expand Up @@ -905,4 +905,4 @@ This package likely contains an assembly that is blocked. You will need to load
<data name="DynamoLanguages_noxlate" xml:space="preserve">
<value>English,Čeština,Deutsch,Español,Français,Italiano,日本語,한국어,Polski,Português (Brasil),Русский,简体中文,繁體中文</value>
</data>
</root>
</root>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
Expand Down Expand Up @@ -160,7 +161,9 @@ private void OnMouseEnter(object sender, MouseEventArgs e)
DisplayOrHideConfidenceTooltip(sender);

dynamic currentNodeSearchElement = currentListBoxItem.DataContext;
confidenceScoreTitle.Text = $"{Res.ConfidenceToolTipTitle}: {currentNodeSearchElement.AutoCompletionNodeMachineLearningInfo.ConfidenceScore}%";
var scoreFormatter = new Dynamo.Controls.ConfidenceScoreFormattingConverter();
var score = scoreFormatter.Convert(currentNodeSearchElement.AutoCompletionNodeMachineLearningInfo.ConfidenceScore, null, null, CultureInfo.CurrentCulture);
confidenceScoreTitle.Text = $"{Res.ConfidenceToolTipTitle}: {score}%";
}

private void onCloseConfidenceToolTip(object sender, RoutedEventArgs e)
Expand Down
2 changes: 1 addition & 1 deletion src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
Command="{Binding SignOutCommand}"
Name="logoutOption">
<MenuItem.ToolTip>
<ToolTip Content="Sign Out" Style="{StaticResource GenericToolTipLight}"/>
<ToolTip Content="{x:Static p:Resources.LogoutMenuItemText}" Style="{StaticResource GenericToolTipLight}"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

</MenuItem.ToolTip>
</MenuItem>
</MenuItem>
Expand Down
4 changes: 2 additions & 2 deletions src/DynamoCoreWpf/Properties/Resources.Designer.cs

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

30 changes: 15 additions & 15 deletions src/DynamoCoreWpf/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2560,10 +2560,10 @@ Do you wish to uninstall {1}? Restart {2} to complete the uninstall and try down
<value>Finished</value>
</data>
<data name="GroupDefaultText" xml:space="preserve">
<value>&lt;Double click here to edit group description&gt;</value>
<value>Description &lt;Double click here to edit group description&gt;</value>
</data>
<data name="GroupNameDefaultText" xml:space="preserve">
<value>&lt;Click here to edit the group title&gt;</value>
<value>Title &lt;Click here to edit the group title&gt;</value>
</data>
<data name="GroupContextMenuAddGroupToGroup" xml:space="preserve">
<value>Add Group to This Group</value>
Expand Down Expand Up @@ -3537,28 +3537,28 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in
<value>Library</value>
</data>
<data name="PortPropertiesPromptInputWindowTitle">
<value>Input Port Properties</value>
<comment>Input Port title</comment>
<value>Input Port Properties</value>
<comment>Input Port title</comment>
</data>
<data name="PortPropertiesPromptOutputWindowTitle">
<value>Output Port Properties</value>
<comment>Output Port title</comment>
<value>Output Port Properties</value>
<comment>Output Port title</comment>
</data>
<data name="PortPropertiesPromptDescriptionTooltip">
<value>Description of port</value>
<comment>Description of port</comment>
<value>Description of port</value>
<comment>Description of port</comment>
</data>
<data name="PortPropertiesPromptWindowDescription">
<value>Description</value>
<comment>Port Description Label</comment>
<value>Description</value>
<comment>Port Description Label</comment>
</data>
<data name="PortPropertiesPromptNameTooltip">
<value>Port name</value>
<comment>Name of port</comment>
<value>Port name</value>
<comment>Name of port</comment>
</data>
<data name="PortPropertiesPromptWindowName">
<value>Name</value>
<comment>Port Name Label</comment>
<data name="PortPropertiesPromptWindowName">
<value>Name</value>
<comment>Port Name Label</comment>
</data>
<data name="RemovePythonPortWarningMessageBoxTitle" xml:space="preserve">
<value>Remove port?</value>
Expand Down
32 changes: 16 additions & 16 deletions src/DynamoCoreWpf/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1835,7 +1835,7 @@ Do you want to install the latest Dynamo update?</value>
<value>Run started with new working range...</value>
</data>
<data name="GroupDefaultText" xml:space="preserve">
<value>&lt;Double click here to edit group description&gt;</value>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we using the same resource string in both Core and CoreWpf? Should we get rid of one of them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we are using the same resource string in both, but the Wpf resources are unavailable in Core.

<value>Description &lt;Double click here to edit group description&gt;</value>
</data>
<data name="GroupContextMenuBackground" xml:space="preserve">
<value>Select Background</value>
Expand Down Expand Up @@ -2541,11 +2541,11 @@ Uninstall the following packages: {0}?</value>
<value>Confidence rating</value>
<comment>Confidence tooltip title</comment>
</data>
<data name="ConfidenceToolTipDescription" xml:space="preserve">
<data name="ConfidenceToolTipDescription" xml:space="preserve">
<value>Represents estimated probability that the given node is the right choice. Recommended nodes are listed in order from highest to lowest confidence level. Confidence level percentages for all recommended nodes add up to about 100%.</value>
<comment>Confidence tooltip description</comment>
</data>
<data name="ConfidenceToolTipoLearnMore" xml:space="preserve">
<data name="ConfidenceToolTipoLearnMore" xml:space="preserve">
<value>Learn more</value>
<comment>Confidence tooltip Learn more</comment>
</data>
Expand Down Expand Up @@ -2805,7 +2805,7 @@ Do you wish to uninstall {1}? Restart {2} to complete the uninstall and try down
<value>Finished</value>
</data>
<data name="GroupNameDefaultText" xml:space="preserve">
<value>&lt;Double click here to edit group title&gt;</value>
<value>Title &lt;Double click here to edit group title&gt;</value>
</data>
<data name="GroupContextMenuAddGroupToGroup" xml:space="preserve">
<value>Add Group to This Group</value>
Expand Down Expand Up @@ -3524,28 +3524,28 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in
<value>Library</value>
</data>
<data name="PortPropertiesPromptInputWindowTitle">
<value>Input Port Properties</value>
<comment>Input Port title</comment>
<value>Input Port Properties</value>
<comment>Input Port title</comment>
</data>
<data name="PortPropertiesPromptOutputWindowTitle">
<value>Output Port Properties</value>
<comment>Output Port title</comment>
<value>Output Port Properties</value>
<comment>Output Port title</comment>
</data>
<data name="PortPropertiesPromptDescriptionTooltip">
<value>Description of port</value>
<comment>Description of port</comment>
<value>Description of port</value>
<comment>Description of port</comment>
</data>
<data name="PortPropertiesPromptWindowDescription">
<value>Description</value>
<comment>Port Description Label</comment>
<value>Description</value>
<comment>Port Description Label</comment>
</data>
<data name="PortPropertiesPromptNameTooltip">
<value>Port name</value>
<comment>Name of port</comment>
<value>Port name</value>
<comment>Name of port</comment>
</data>
<data name="PortPropertiesPromptWindowName">
<value>Name</value>
<comment>Port Name Label</comment>
<value>Name</value>
<comment>Port Name Label</comment>
</data>
<data name="RemovePythonPortWarningMessageBoxTitle" xml:space="preserve">
<value>Remove port?</value>
Expand Down
23 changes: 23 additions & 0 deletions src/DynamoCoreWpf/UI/Converters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2595,6 +2595,29 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu
}
}

/// <summary>
/// This converts the ML node autocomplete confidence score to a formatted string for display.
/// </summary>
public class ConfidenceScoreFormattingConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var text = value == null ? string.Empty : value.ToString();
var score = value == null ? 0 : (double)value;
if (score < 1)
{
text = "<1";
}
return text;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
var text = value.ToString();
return text;
}
}

public class MenuItemCheckConverter : IValueConverter
{
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions src/DynamoCoreWpf/UI/Themes/Modern/DynamoConverters.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
<controls:NullValueToCollapsedConverter x:Key="NullValueToCollapsedConverter" />
<controls:NullValueToGridRow1Converter x:Key="NullValueToGridRow1Converter" />
<controls:SearchHighlightMarginConverter x:Key="SearchHighlightMarginConverter" />
<controls:ConfidenceScoreFormattingConverter x:Key="ConfidenceScoreFormattingConverter" />
<controls:InOutParamTypeConverter x:Key="InOutParamTypeConverter" />
<controls:NodeTypeToColorConverter
x:Key="NodeTypeToColorConverter"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,12 @@
<StackPanel Visibility="{Binding Path=AutoCompletionNodeMachineLearningInfo.DisplayIcon, Converter={StaticResource BooleanToVisibilityConverter}}">
<TextBlock
HorizontalAlignment="Center"
Width="25"
MinWidth="25"
MaxWidth="33"
FontSize="11"
Margin="5,12,0,0"
Visibility="{Binding Path=AutoCompletionNodeMachineLearningInfo.IsByRecommendation, Converter={StaticResource BooleanToVisibilityConverter}}"
Text="{Binding AutoCompletionNodeMachineLearningInfo.ConfidenceScore, StringFormat= {}{0} %, Mode=OneWay}" Foreground="{StaticResource DynamoStandardLabelTextBrush}">
Text="{Binding AutoCompletionNodeMachineLearningInfo.ConfidenceScore, StringFormat= {}{0} %, Mode=OneWay, Converter={StaticResource ConfidenceScoreFormattingConverter}}" Foreground="{StaticResource DynamoStandardLabelTextBrush}">
</TextBlock>
<Image HorizontalAlignment="Center"
Height="14"
Expand Down
14 changes: 7 additions & 7 deletions src/DynamoCoreWpf/Views/Core/NodeView.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<UserControl x:Class="Dynamo.Controls.NodeView"
<UserControl x:Class="Dynamo.Controls.NodeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:configuration="clr-namespace:Dynamo.Configuration;assembly=DynamoCore"
Expand Down Expand Up @@ -306,11 +306,11 @@
Panel.ZIndex="3"
FlowDirection="LeftToRight">
<!-- The Icon for this Node -->
<Ellipse Name="nodeIcon"
<Rectangle Name="nodeIcon"
Width="34"
Height="34">
<Ellipse.Style>
<Style TargetType="Ellipse">
<Rectangle.Style>
<Style TargetType="Rectangle">
<Setter Property="Fill">
<Setter.Value>
<ImageBrush ImageSource="{Binding ImageSource}" Stretch="UniformToFill" />
Expand All @@ -327,8 +327,8 @@
</DataTrigger>
</Style.Triggers>
</Style>
</Ellipse.Style>
</Ellipse>
</Rectangle.Style>
</Rectangle>

<TextBlock Name="NameBlock"
Margin="6,3,6,0"
Expand Down Expand Up @@ -734,4 +734,4 @@
<Label HorizontalContentAlignment="Center" Content="{Binding ASTText}" />
</Canvas>
</Grid>
</UserControl>
</UserControl>
29 changes: 15 additions & 14 deletions src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -807,19 +807,20 @@
Margin="10,0,0,0"
VerticalAlignment="Center"
Foreground="{StaticResource PreferencesWindowFontColor}"/>
<Image Name="MLNodeAutocompleteToolTip"
Margin="5,3,0,0"
Width="14"
Height="14"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Style="{StaticResource QuestionIconClickable}"
MouseDown="OnMoreInfoClicked"
ToolTipService.ShowDuration="30000">
<Image.ToolTip>
<ToolTip Content="{x:Static p:Resources.PreferencesViewEnableNodeAutoCompleteTooltipText}" Style="{StaticResource GenericToolTipLight}"/>
</Image.ToolTip>
</Image>
<Label Name="MLNodeAutocompleteLabel" MouseLeftButtonDown="OnMoreInfoClicked">
<Image Name="MLNodeAutocompleteToolTip"
Margin="5,3,0,0"
Width="14"
Height="14"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Style="{StaticResource QuestionIconClickable}"
ToolTipService.ShowDuration="30000">
<Image.ToolTip>
<ToolTip Content="{x:Static p:Resources.PreferencesViewEnableNodeAutoCompleteTooltipText}" Style="{StaticResource GenericToolTipLight}"/>
</Image.ToolTip>
</Image>
</Label>
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="0,-5,0,0" Grid.Row="1"
Expand Down Expand Up @@ -1681,7 +1682,7 @@
Height="14"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Style="{StaticResource QuestionIcon}"
Style="{StaticResource QuestionIconClickable}"
ToolTipService.ShowDuration="30000">
<Image.ToolTip>
<ToolTip Content="{x:Static p:Resources.PreferencesViewTrustWarningTooltipText}" Style="{StaticResource GenericToolTipLight}"/>
Expand Down
Loading