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

Dynamo SignIn UI toolbar fixes and tooltip updates #14842

Merged
merged 32 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
56ba101
Fix PostDiff job
zeusongit Aug 11, 2023
dc250de
Merge branch 'master' of https://github.com/zeusongit/Dynamo
zeusongit Aug 11, 2023
1fecd29
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
zeusongit Aug 16, 2023
90a6c41
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
zeusongit Aug 28, 2023
64c202b
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
zeusongit Aug 29, 2023
d6ac751
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
zeusongit Sep 5, 2023
255feeb
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
zeusongit Sep 7, 2023
4e55f7f
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
zeusongit Sep 8, 2023
1886669
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
zeusongit Sep 8, 2023
8ac6b74
Merge branch 'master' of https://github.com/zeusongit/Dynamo
zeusongit Sep 12, 2023
41c461c
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
zeusongit Sep 12, 2023
f9cf237
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
zeusongit Sep 28, 2023
a0adaef
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
zeusongit Oct 13, 2023
2ab3d49
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
zeusongit Oct 17, 2023
558df01
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
zeusongit Oct 20, 2023
efdb82b
Merge branch 'master' of https://github.com/zeusongit/Dynamo
zeusongit Oct 20, 2023
9b712f2
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
zeusongit Oct 23, 2023
7c2dc1e
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
zeusongit Oct 25, 2023
83bcb52
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
zeusongit Nov 1, 2023
30b861d
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
zeusongit Nov 3, 2023
71d23c2
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
zeusongit Dec 1, 2023
cd1c4f9
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
zeusongit Dec 1, 2023
0cae237
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
zeusongit Dec 6, 2023
d9d38c8
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
zeusongit Dec 12, 2023
ecebcda
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
zeusongit Dec 13, 2023
a53e033
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
zeusongit Dec 20, 2023
764342d
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
zeusongit Jan 3, 2024
83b1162
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
zeusongit Jan 10, 2024
8538a67
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
zeusongit Jan 11, 2024
34a3a30
fixes 1 and 2
zeusongit Jan 12, 2024
630aac4
DYN-5868 fix-3
zeusongit Jan 12, 2024
600cbfa
Merge branch 'master' of https://github.com/DynamoDS/Dynamo into sign…
zeusongit Jan 12, 2024
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
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.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
20 changes: 19 additions & 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.

10 changes: 8 additions & 2 deletions src/DynamoCoreWpf/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2589,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 @@ -3879,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>
</root>
<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>
10 changes: 8 additions & 2 deletions src/DynamoCoreWpf/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2877,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 @@ -3866,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>
</root>
<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
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