Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/DynamoDS/Dynamo into warn…
Browse files Browse the repository at this point in the history
…-fix
  • Loading branch information
zeusongit committed Jan 16, 2024
2 parents eadf2a9 + 8406ccf commit 5c73541
Show file tree
Hide file tree
Showing 33 changed files with 841 additions and 151 deletions.
Binary file removed doc/distrib/Samples/Data/DynamoSample_2022.rvt
Binary file not shown.
Binary file added doc/distrib/Samples/Data/DynamoSample_2025.rvt
Binary file not shown.
2 changes: 1 addition & 1 deletion src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
</MenuItem.Header>
<MenuItem Focusable="False"
Header="{x:Static p:Resources.LogoutMenuItemText}"
Command="{Binding SignOutCommand}"
Click="LogoutOption_Click"
Name="logoutOption">
<MenuItem.ToolTip>
<ToolTip Content="{x:Static p:Resources.LogoutMenuItemText}" Style="{StaticResource GenericToolTipLight}"/>
Expand Down
32 changes: 27 additions & 5 deletions src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,17 @@ public ShortcutToolbar(DynamoViewModel dynamoViewModel)
var shortcutToolbar = new ShortcutToolbarViewModel(dynamoViewModel);
DataContext = shortcutToolbar;
authManager = dynamoViewModel.Model.AuthenticationManager;
if (authManager.IsLoggedInInitial())
if (authManager != null)
{
authManager.LoginStateChanged += AuthChangeHandler;
}
else {
logoutOption.Visibility = Visibility.Collapsed;
if (authManager.LoginState == LoginState.LoggedIn && loginMenu.Items.Count == 0)
{
loginMenu.Items.Add(logoutOption);
}
else
{
loginMenu.Items.Remove(logoutOption);
}
}

this.Loaded += ShortcutToolbar_Loaded;
Expand Down Expand Up @@ -90,12 +95,17 @@ private void AuthChangeHandler(LoginState status)
LoginButton.ToolTip = Wpf.Properties.Resources.SignInButtonContentToolTip;
txtSignIn.Text = Wpf.Properties.Resources.SignInButtonText;
logoutOption.Visibility = Visibility.Collapsed;
loginMenu.Items.Remove(logoutOption);
}
else if (status == LoginState.LoggedIn)
{
txtSignIn.Text = authManager.Username;
logoutOption.Visibility = Visibility.Visible;
LoginButton.ToolTip = null;
if (loginMenu.Items.Count == 0)
{
loginMenu.Items.Add(logoutOption);
}
logoutOption.Visibility = Visibility.Visible;
}
}

Expand Down Expand Up @@ -134,6 +144,18 @@ private void LoginButton_OnClick(object sender, RoutedEventArgs e)
}
}

private void LogoutOption_Click(object sender, RoutedEventArgs e)
{
if (authManager.LoginState == LoginState.LoggedIn)
{
var result = Wpf.Utilities.MessageBoxService.Show(Application.Current?.MainWindow, Wpf.Properties.Resources.SignOutConfirmationDialogText, Wpf.Properties.Resources.SignOutConfirmationDialogTitle,MessageBoxButton.OKCancel, new List<string>() { "Sign Out", "Cancel"}, MessageBoxImage.Information);
if (result == MessageBoxResult.OK)
{
authManager.ToggleLoginState(null);
}
}
}

public List<Control> AllChildren(DependencyObject parent)
{
var _list = new List<Control> { };
Expand Down
37 changes: 23 additions & 14 deletions src/DynamoCoreWpf/Properties/Resources.Designer.cs

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

19 changes: 11 additions & 8 deletions src/DynamoCoreWpf/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ Don't worry, you'll have the option to save your work.</value>
<comment>Setting menu | Decimal inch</comment>
</data>
<data name="DynamoViewSettingMenuShowDataReportingDialog" xml:space="preserve">
<value>Agreement and _Terms of Use</value>
<value>Agreements for _Data Collection</value>
<comment>Dynamo menu | Show user agreement dialog about data collecting</comment>
</data>
<data name="DynamoViewSettingMenuFractionalFoot" xml:space="preserve">
Expand Down Expand Up @@ -2220,10 +2220,10 @@ Installing the latest update requires Dynamo and any host applications to close.
Do you want to install the latest Dynamo update?</value>
</data>
<data name="UsageReportPromptDialogTitle" xml:space="preserve">
<value>Agreement and Terms of Use</value>
<value>Agreements for Data Collection</value>
</data>
<data name="AgreeToMLAutocompleteTOUText" xml:space="preserve">
<value>I would like to participate in data collection</value>
<value>I would like to participate in data collection for Machine Learning Programs</value>
</data>
<data name="UseLevelKeepListStructureHint" xml:space="preserve">
<value>Keep 1 input list's nesting</value>
Expand Down Expand Up @@ -2315,9 +2315,6 @@ Uninstall the following packages: {0}?</value>
<data name="PackageSearchViewFilterByButton" xml:space="preserve">
<value>Filter by</value>
</data>
<data name="DynamoViewSettingMenuShowDataReportingDialogTooltip" xml:space="preserve">
<value>Display the dialog of agreement on data collecting and Machine Learning Node Autocomplete terms of use</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="psDynamoMesh" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\ViewModels\Watch3D\compiledShaders\psDynamoMesh;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
Expand Down Expand Up @@ -2592,7 +2589,7 @@ Do you wish to uninstall {1}? Restart {2} to complete the uninstall and try down
<value>Package/Library Search Paths</value>
</data>
<data name="PreferencesViewShowRunPreviewTooltip" xml:space="preserve">
<value>Switchable only when the current workspace is in Manual run mode.</value>
<value>To preview the execution state of your graph, wires connected to ports that will be affected by a graph run are highlighted in orange. Available only when the current workspace is in Manual run mode.</value>
</data>
<data name="PersistentVisualStatusOfLinterIssues" xml:space="preserve">
<value>Issues found</value>
Expand Down Expand Up @@ -3859,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 All @@ -3882,4 +3879,10 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in
<data name="GESUnitMillimeters" xml:space="preserve">
<value>Millimeters</value>
</data>
<data name="SignOutConfirmationDialogText" xml:space="preserve">
<value>Signing out of Dynamo will sign you out of all Autodesk desktop products.</value>
</data>
<data name="SignOutConfirmationDialogTitle" xml:space="preserve">
<value>Sign out of Dynamo</value>
</data>
</root>
19 changes: 11 additions & 8 deletions src/DynamoCoreWpf/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@
<comment>Setting menu | Decimal inch</comment>
</data>
<data name="DynamoViewSettingMenuShowDataReportingDialog" xml:space="preserve">
<value>Agreement and _Terms of Use</value>
<value>Agreements for _Data Collection</value>
<comment>Dynamo menu | Show user agreement dialog about data collecting</comment>
</data>
<data name="DynamoViewSettingShowRunPreview" xml:space="preserve">
Expand Down Expand Up @@ -1151,10 +1151,10 @@ Don't worry, you'll have the option to save your work.</value>
<value>Cancel</value>
</data>
<data name="UsageReportPromptDialogTitle" xml:space="preserve">
<value>Agreement and Terms of Use</value>
<value>Agreements for Data Collection</value>
</data>
<data name="AgreeToMLAutocompleteTOUText" xml:space="preserve">
<value>I would like to participate in data collection</value>
<value>I would like to participate in data collection for Machine Learning Programs</value>
</data>
<data name="DynamoViewContextMenuClearLog" xml:space="preserve">
<value>Clear</value>
Expand Down Expand Up @@ -2605,9 +2605,6 @@ Uninstall the following packages: {0}?</value>
<data name="PackageSearchViewFilterByButton" xml:space="preserve">
<value>Filter by</value>
</data>
<data name="DynamoViewSettingMenuShowDataReportingDialogTooltip" xml:space="preserve">
<value>Display the dialog of agreement on data collecting and Machine Learning Node Autocomplete terms of use</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="psDynamoMesh" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\ViewModels\Watch3D\compiledShaders\psDynamoMesh;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
Expand Down Expand Up @@ -2880,7 +2877,7 @@ Do you wish to uninstall {1}? Restart {2} to complete the uninstall and try down
<value>Package/Library Search Paths</value>
</data>
<data name="PreferencesViewShowRunPreviewTooltip" xml:space="preserve">
<value>Switchable only when the current workspace is in Manual run mode.</value>
<value>To preview the execution state of your graph, wires connected to ports that will be affected by a graph run are highlighted in orange. Available only when the current workspace is in Manual run mode.</value>
</data>
<data name="PersistentVisualStatusOfLinterIssues" xml:space="preserve">
<value>Issues found</value>
Expand Down Expand Up @@ -3846,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 All @@ -3869,4 +3866,10 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in
<data name="GESUnitMillimeters" xml:space="preserve">
<value>Millimeters</value>
</data>
<data name="SignOutConfirmationDialogText" xml:space="preserve">
<value>Signing out of Dynamo will sign you out of all Autodesk desktop products.</value>
</data>
<data name="SignOutConfirmationDialogTitle" xml:space="preserve">
<value>Sign out of Dynamo</value>
</data>
</root>
21 changes: 21 additions & 0 deletions src/DynamoCoreWpf/UI/Prompts/DynamoMessageBox.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,27 @@ internal static MessageBoxResult Show(string messageBoxText, string caption, Mes
return dynamoMessageBox.CustomDialogResult;
}

internal static MessageBoxResult Show(Window owner, string messageBoxText, string caption, MessageBoxButton button, IEnumerable<string> buttonNames,
MessageBoxImage icon)
{
var dynamoMessageBox = new DynamoMessageBox
{
BodyText = messageBoxText,
TitleText = caption,
MessageBoxButton = button,
MessageBoxImage = icon
};

if (owner != null && owner.IsLoaded)
{
dynamoMessageBox.Owner = owner;
}

dynamoMessageBox.ConfigureButtons(button, buttonNames);
dynamoMessageBox.ShowDialog();
return dynamoMessageBox.CustomDialogResult;
}

public event PropertyChangedEventHandler PropertyChanged;

/// <summary>
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
10 changes: 10 additions & 0 deletions src/DynamoCoreWpf/Utilities/MessageBoxUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ internal interface IMessageBox
MessageBoxResult Show(string msg, string title, MessageBoxButton button, MessageBoxImage img);
MessageBoxResult Show(string msg, string title, bool showRichTextBox, MessageBoxButton button, MessageBoxImage img);
MessageBoxResult Show(Window owner,string msg, string title, MessageBoxButton button, MessageBoxImage img);
MessageBoxResult Show(Window owner, string msg, string title, MessageBoxButton button, IEnumerable<string> buttonNames, MessageBoxImage img);
MessageBoxResult Show(string msg, string title, MessageBoxButton button, IEnumerable<string> buttonNames, MessageBoxImage img);
}

Expand All @@ -38,6 +39,11 @@ MessageBoxResult IMessageBox.Show(string msg, string title, MessageBoxButton but
{
return DynamoMessageBox.Show(msg, title, button,buttonNames, img);
}

MessageBoxResult IMessageBox.Show(Window owner, string msg, string title, MessageBoxButton button, IEnumerable<string> buttonNames, MessageBoxImage img)
{
return DynamoMessageBox.Show(owner, msg, title, button, buttonNames, img);
}
}

private static IMessageBox msg_box;
Expand All @@ -57,6 +63,10 @@ public static MessageBoxResult Show(Window owner,string msg, string title, Messa
{
return (msg_box ?? (msg_box = new DefaultMessageBox())).Show(owner,msg, title, button, img);
}
public static MessageBoxResult Show(Window owner, string msg, string title, MessageBoxButton button, IEnumerable<string> buttonNames, MessageBoxImage img)
{
return (msg_box ?? (msg_box = new DefaultMessageBox())).Show(owner, msg, title, button, buttonNames, img);
}
public static MessageBoxResult Show(string msg, string title, MessageBoxButton button, IEnumerable<string> buttonNames, MessageBoxImage img)
{
return (msg_box ?? (msg_box = new DefaultMessageBox())).Show(msg, title, button, buttonNames, img);
Expand Down
Loading

0 comments on commit 5c73541

Please sign in to comment.