Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/DynamoDS/Dynamo into sign…
Browse files Browse the repository at this point in the history
…in-issue-fixes
  • Loading branch information
zeusongit committed Jan 12, 2024
2 parents 630aac4 + 3354472 commit 600cbfa
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 41 deletions.
2 changes: 1 addition & 1 deletion src/DynamoCoreWpf/Properties/Resources.Designer.cs

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

2 changes: 1 addition & 1 deletion src/DynamoCoreWpf/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -3856,7 +3856,7 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in
<value>Element Binding allows a two-way interaction between Dynamo and the host application like Revit or Civil3D where a user can select an element in the host document and have Dynamo "bind" that element to a node in the workspace.</value>
</data>
<data name="NotificationToAgreeMLNodeautocompleteTOU" xml:space="preserve">
<value>To access the Recommended Nodes feature, please read and accept Dynamo &gt; Agreement and Terms of Use.</value>
<value>To access the Recommended Nodes feature, please read and accept Dynamo &gt; Agreements for Data Collection.</value>
</data>
<data name="GESUnitCentimeters" xml:space="preserve">
<value>Centimeters</value>
Expand Down
2 changes: 1 addition & 1 deletion src/DynamoCoreWpf/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -3843,7 +3843,7 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in
<value>Element Binding allows a two-way interaction between Dynamo and the host application like Revit or Civil3D where a user can select an element in the host document and have Dynamo "bind" that element to a node in the workspace.</value>
</data>
<data name="NotificationToAgreeMLNodeautocompleteTOU" xml:space="preserve">
<value>To access the Recommended Nodes feature, please read and accept Dynamo &gt; Agreement and Terms of Use.</value>
<value>To access the Recommended Nodes feature, please read and accept Dynamo &gt; Agreements for Data Collection.</value>
</data>
<data name="GESUnitCentimeters" xml:space="preserve">
<value>Centimeters</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
Grid.Row="4">
<CheckBox x:Name="AgreeToMLAutocompleteTOUCheckbox"/>
<TextBlock x:Name="AgreeToMLAutocompleteTOUTextbox"
Margin="10,0,0,0"
Margin="0,1,0,0"
Text="{x:Static p:Resources.AgreeToMLAutocompleteTOUText}"/>
</StackPanel>
<!--Configure ADP Consent-->
Expand Down
17 changes: 15 additions & 2 deletions src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,14 @@ public string SelectedUnits

if (UseHostScaleUnits && IsDynamoRevit) return;

var result = Enum.TryParse(selectedUnits, out Configurations.Units currentUnit);
var enUnit = LocalizedUnitsMap.FirstOrDefault(x => x.Key == selectedUnits).Value;
var result = Enum.TryParse(enUnit, out Configurations.Units currentUnit);
if (!result) return;

if (Configurations.SupportedUnits.TryGetValue(currentUnit, out double units))
{
// Update preferences setting and update the grapic helpers
preferenceSettings.GraphicScaleUnit = value;
preferenceSettings.GraphicScaleUnit = currentUnit.ToString();
preferenceSettings.GridScaleFactor = (float)units;
dynamoViewModel.UpdateGraphicHelpersScaleCommand.Execute(null);

Expand Down Expand Up @@ -1291,6 +1292,12 @@ public bool importSettingsContent(string content)
return setSettings(newPreferences);
}

/// <summary>
/// The dictionary that contains the localized resource strings for Units.
/// This is done to avoid a breaking change that is storing the selected unit in settings file in english language.
/// </summary>
private Dictionary<string, string> LocalizedUnitsMap;

/// <summary>
/// Returns localized resource strings for Units
/// </summary>
Expand Down Expand Up @@ -1392,6 +1399,12 @@ public PreferencesViewModel(DynamoViewModel dynamoViewModel)
LanguagesList = Configurations.SupportedLocaleDic.Keys.ToObservableCollection();
SelectedLanguage = Configurations.SupportedLocaleDic.FirstOrDefault(x => x.Value == preferenceSettings.Locale).Key;

LocalizedUnitsMap = new Dictionary<string, string>();
foreach (var unit in Configurations.SupportedUnits)
{
LocalizedUnitsMap.Add(GetLocalizedUnits(unit.Key), unit.Key.ToString());
}

// Chose the scaling unit, if option is allowed by user
UnitList = Configurations.SupportedUnits.Keys.Select(x => GetLocalizedUnits(x)).ToObservableCollection();
SelectedUnits = GetLocalizedUnits(Configurations.SupportedUnits.FirstOrDefault(x => x.Key.ToString() == preferenceSettings.GraphicScaleUnit).Key);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--
<!--
Dynamo: https://github.com/DynamoDS/Dynamo
-->
<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->
Expand Down Expand Up @@ -162,11 +162,11 @@ <h4>What are packages?</h4>
</p>
<h4>Installing Dynamo packages</h4>
<p>
You can browse and install packages in the Search for Packages tab of the Package Manager. Use the search field to locate specific packages.
You can browse and install packages in the Search for Packages tab of the Package Manager. Use the search field to locate specific packages.
You can also apply filters and sorting to narrow down the list to meet your criteria, such as a host program or lack of dependencies.
</p>
<p>
To view more information about a package, click View Details. This opens a panel where you can read a description of the package, find version and license information, and more.
To view more information about a package, click View Details. This opens a panel where you can read a description of the package, find version and license information, and more.
</p>
<p>
To install a package, click Install either in the search view or in the details panel. You can specify a version to install in the search view by clicking the drop-down and selecting a version; otherwise, the most recent version will be installed.
Expand All @@ -177,10 +177,10 @@ <h4>Installing Dynamo packages</h4>
</p>
<h4>Publishing Dynamo Packages</h4>
<p>
The Package Manager allows you to publish packages inside Dynamo. Open the Publish a Package tab to get started.
The Package Manager allows you to publish packages inside Dynamo. Open the Publish a Package tab to get started.
The Publish a Package tab asks for all required and optional information related to the package that you want to publish.
</p>

<h4>Adding package details</h4>

<p>
Expand Down Expand Up @@ -236,41 +236,44 @@ <h4>Adding package files</h4>
</p>
<p>
<b>Add Files/Directory:</b><br />
<p>
Select and add all the files that are related to your package. Generally, the bin folder, binaries, and dependencies are added.
You can add individual files or folders.
</p>
<p>
After you’ve selected files or folders to add, you can view, remove, or add files on the Select Package Contents page.
You can view the folder structure of your selected files in the left panel, and the contents of each folder in the right panel.
</p>
<p>
Select and add all the files that are related to your package. Generally, the bin folder, binaries, and dependencies are added.
You can add individual files or folders.
</p>
<p>
After you’ve selected files or folders to add, you can view, remove, or add files on the Select Package Contents page.
You can view the folder structure of your selected files in the left panel, and the contents of each folder in the right panel.
</p>
<p>
<b>Select Node Libraries:</b><br />
<p>
Specify which of the files you added to the package are the node libraries by checking the box in the Node Library column.
Node libraries contain the types and methods that Dynamo will import as nodes. In general, you should mark any assembly as a node library which contains types you wish to import into Dynamo.
ZeroTouch, NodeModel, or NodeViewCustomization assemblies should be marked as a node library.
</p>
<p>
To load UI NodeViewCustomizations, they should be either defined in the same assembly that contains the corresponding NodeModel definitions OR defined in a separate assembly.
In either case, the assembly must be tagged as a node library. Currently, for assemblies marked as node library that contain NodeModel or NodeCustomization types, all other types will be ignored. For this reason, it is important to separate NodeModel/NodeViewCustomization types from types you wish to import using ZeroTouch import.
</p>
<p>
Specify which of the files you added to the package are the node libraries by checking the box in the Node Library column.
Node libraries contain the types and methods that Dynamo will import as nodes. In general, you should mark any assembly as a node library which contains types you wish to import into Dynamo.
ZeroTouch, NodeModel, or NodeViewCustomization assemblies should be marked as a node library.
</p>
<p>
To load UI NodeViewCustomizations, they should be either defined in the same assembly that contains the corresponding NodeModel definitions OR defined in a separate assembly.
In either case, the assembly must be tagged as a node library. Currently, for assemblies marked as node library that contain NodeModel or NodeCustomization types, all other types will be ignored. For this reason, it is important to separate NodeModel/NodeViewCustomization types from types you wish to import using ZeroTouch import.
</p>
</p>
<!-- TODO, uncomment after DYN-6589
<p>
<b>Retain folder structure:</b><br />
<p>
Advanced package authors with complex package folder structures may want to enable the Retain Folder Structure toggle below the package contents preview panel.
When this setting is toggled on, Dynamo won’t make changes to your package folder structure; instead, the package will be uploaded as is.
</p>
<p>
This is an advanced setting because packages need to be set up in a certain way to ensure they work and to avoid any issues.
This is an advanced setting because packages need to be set up in a certain way to ensure they work and to avoid any issues.
When in doubt, toggle the setting off to allow Dynamo to set up the folder structure.
</p>
</p>
-->
<p>
<b>Preview Package Contents:</b><br />
When you are satisfied with your package contents, click Next to see a preview of how the package files will be set up once they are published.
This page is view only; to make additional changes to the package contents, go back to the previous page. Click Finish to return to the package details page.
When you are satisfied with your package contents, click Next to see a preview of how the package files will be set up once they are published.
This page is view only; to make additional changes to the package contents, go back to the previous page. Click Finish to return to the package details page.
</p>
<p>
<b>Add markdown file path (optional):</b><br />
Expand All @@ -282,13 +285,13 @@ <h4>Adding package files</h4>
</p>

<hr />

<h3>Anti-virus Scans</h3>
<p>
To provide a secure environment to all Dynamo package users, we have introduced anti-virus scans for new packages.
When a user uploads a package, it will be scanned for viruses and will only be available publicly once it has been flagged as safe.
The scan will happen during the package upload process and will not add to the usual duration of 10-15 minutes for the new package to be available online.
If your package is flagged as infected, the Package Manager search page will display a notification stating that the uploaded package has been found to be infected and won't be published online.
To provide a secure environment to all Dynamo package users, we have introduced anti-virus scans for new packages.
When a user uploads a package, it will be scanned for viruses and will only be available publicly once it has been flagged as safe.
The scan will happen during the package upload process and will not add to the usual duration of 10-15 minutes for the new package to be available online.
If your package is flagged as infected, the Package Manager search page will display a notification stating that the uploaded package has been found to be infected and won't be published online.
To make the package publicly available, check the files included with the package and upload a new version through the Package Manager.
</p>
<h3>Managing your packages</h3>
Expand All @@ -299,4 +302,4 @@ <h3>Package Settings</h3>
<p>
You can view your package-related settings in the Package Settings tab of the Package Manager, including new package download paths and package/library search paths. To edit your settings, click the Preferences link in the Package Settings tab to access the Preferences panel.
</p>
</body>
</body>
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ private void PackageManagerPanel_MouseDown(object sender, MouseButtonEventArgs e
/// <param name="e"></param>
private void CloseButton_Click(object sender, RoutedEventArgs e)
{
Analytics.TrackEvent(Actions.Close, Categories.PackageManager);
(this.Owner as DynamoView).EnableOverlayBlocker(false);
Analytics.TrackEvent(Actions.Close, Categories.PackageManager);

Close();
}
Expand All @@ -143,6 +142,7 @@ private void WindowClosed(object sender, EventArgs e)
{
this.packageManagerPublish?.Dispose();
this.packageManagerSearch?.Dispose();
(this.Owner as DynamoView).EnableOverlayBlocker(false);

if (PackageManagerViewModel == null) return;
this.PackageManagerViewModel.PackageSearchViewModel.RequestShowFileDialog -= OnRequestShowFileDialog;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@
</Rectangle>

<!--Toggle-->
<!-- TODO, uncomment after DYN-6589
<StackPanel Orientation="Horizontal"
Grid.Column="1"
Grid.Row="2">
Expand All @@ -609,7 +610,6 @@
Style="{StaticResource GenericToolTipLight}" />
</Rectangle.ToolTip>
</Rectangle>

</StackPanel>
</StackPanel>-->
</Grid>
</Page>

0 comments on commit 600cbfa

Please sign in to comment.