From 56ba10186069f41191debf6b89ad2e92c91cc99f Mon Sep 17 00:00:00 2001 From: Ashish Aggarwal Date: Fri, 11 Aug 2023 10:14:43 -0400 Subject: [PATCH 1/3] Fix PostDiff job --- .github/workflows/clear_cache.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/clear_cache.yml b/.github/workflows/clear_cache.yml index 37ef5949bd8..0f2e0ab5dd5 100644 --- a/.github/workflows/clear_cache.yml +++ b/.github/workflows/clear_cache.yml @@ -77,8 +77,8 @@ jobs: echo "Deleting caches..." echo "Deleting: $WNNUM-cache-net60Win-current" gh actions-cache delete $WNNUM-cache-net60Win-current -R $REPO --confirm - echo "Deleting: $WNNUM-cache-current" - gh actions-cache delete $WNNUM-cache-current -R $REPO --confirm + echo "Deleting: $WNNUM-cache-net60Win-master" + gh actions-cache delete $WNNUM-cache-master -R $REPO --confirm env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 34a3a301a24098b3b566af9d65572215afea7124 Mon Sep 17 00:00:00 2001 From: Ashish Aggarwal Date: Fri, 12 Jan 2024 14:29:49 -0500 Subject: [PATCH 2/3] fixes 1 and 2 --- .../Controls/ShortcutToolbar.xaml | 2 +- .../Controls/ShortcutToolbar.xaml.cs | 32 ++++++++++++++++--- .../Properties/Resources.Designer.cs | 18 +++++++++++ .../Properties/Resources.en-US.resx | 8 ++++- src/DynamoCoreWpf/Properties/Resources.resx | 8 ++++- .../UI/Prompts/DynamoMessageBox.xaml.cs | 21 ++++++++++++ .../Utilities/MessageBoxUtilities.cs | 10 ++++++ 7 files changed, 91 insertions(+), 8 deletions(-) diff --git a/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml b/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml index 5cb110c3de7..46a4439fc81 100644 --- a/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml +++ b/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml @@ -216,7 +216,7 @@ diff --git a/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml.cs b/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml.cs index 043d9f46b03..425d91741e3 100644 --- a/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml.cs +++ b/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml.cs @@ -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; @@ -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; } } @@ -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() { "Sign Out", "Cancel"}, MessageBoxImage.Information); + if (result == MessageBoxResult.OK) + { + authManager.ToggleLoginState(null); + } + } + } + public List AllChildren(DependencyObject parent) { var _list = new List { }; diff --git a/src/DynamoCoreWpf/Properties/Resources.Designer.cs b/src/DynamoCoreWpf/Properties/Resources.Designer.cs index 5149c86c9a3..b0f4d25e171 100644 --- a/src/DynamoCoreWpf/Properties/Resources.Designer.cs +++ b/src/DynamoCoreWpf/Properties/Resources.Designer.cs @@ -9183,6 +9183,24 @@ public static string SigningInButtonText { } } + /// + /// Looks up a localized string similar to Signing out of Dynamo will sign you out of all Autodesk desktop products.. + /// + public static string SignOutConfirmationDialogText { + get { + return ResourceManager.GetString("SignOutConfirmationDialogText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sign out of Dynamo. + /// + public static string SignOutConfirmationDialogTitle { + get { + return ResourceManager.GetString("SignOutConfirmationDialogTitle", resourceCulture); + } + } + /// /// Looks up a localized string similar to Please update the permissions or go to Preferences >Node and Package Paths...' to change your default directory.. /// diff --git a/src/DynamoCoreWpf/Properties/Resources.en-US.resx b/src/DynamoCoreWpf/Properties/Resources.en-US.resx index 9dcd6add055..f613a2b56c2 100644 --- a/src/DynamoCoreWpf/Properties/Resources.en-US.resx +++ b/src/DynamoCoreWpf/Properties/Resources.en-US.resx @@ -3879,4 +3879,10 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in Millimeters - + + Signing out of Dynamo will sign you out of all Autodesk desktop products. + + + Sign out of Dynamo + + \ No newline at end of file diff --git a/src/DynamoCoreWpf/Properties/Resources.resx b/src/DynamoCoreWpf/Properties/Resources.resx index f8530049348..cc366e0db1b 100644 --- a/src/DynamoCoreWpf/Properties/Resources.resx +++ b/src/DynamoCoreWpf/Properties/Resources.resx @@ -3866,4 +3866,10 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in Millimeters - + + Signing out of Dynamo will sign you out of all Autodesk desktop products. + + + Sign out of Dynamo + + \ No newline at end of file diff --git a/src/DynamoCoreWpf/UI/Prompts/DynamoMessageBox.xaml.cs b/src/DynamoCoreWpf/UI/Prompts/DynamoMessageBox.xaml.cs index 6767be18120..c2d4617ae5e 100644 --- a/src/DynamoCoreWpf/UI/Prompts/DynamoMessageBox.xaml.cs +++ b/src/DynamoCoreWpf/UI/Prompts/DynamoMessageBox.xaml.cs @@ -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 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; /// diff --git a/src/DynamoCoreWpf/Utilities/MessageBoxUtilities.cs b/src/DynamoCoreWpf/Utilities/MessageBoxUtilities.cs index a77304c0516..a96ebdb83aa 100644 --- a/src/DynamoCoreWpf/Utilities/MessageBoxUtilities.cs +++ b/src/DynamoCoreWpf/Utilities/MessageBoxUtilities.cs @@ -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 buttonNames, MessageBoxImage img); MessageBoxResult Show(string msg, string title, MessageBoxButton button, IEnumerable buttonNames, MessageBoxImage img); } @@ -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 buttonNames, MessageBoxImage img) + { + return DynamoMessageBox.Show(owner, msg, title, button, buttonNames, img); + } } private static IMessageBox msg_box; @@ -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 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 buttonNames, MessageBoxImage img) { return (msg_box ?? (msg_box = new DefaultMessageBox())).Show(msg, title, button, buttonNames, img); From 630aac4181e7c995038c69e281b5f38d375f7956 Mon Sep 17 00:00:00 2001 From: Ashish Aggarwal Date: Fri, 12 Jan 2024 14:34:42 -0500 Subject: [PATCH 3/3] DYN-5868 fix-3 --- src/DynamoCoreWpf/Properties/Resources.Designer.cs | 2 +- src/DynamoCoreWpf/Properties/Resources.en-US.resx | 2 +- src/DynamoCoreWpf/Properties/Resources.resx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/DynamoCoreWpf/Properties/Resources.Designer.cs b/src/DynamoCoreWpf/Properties/Resources.Designer.cs index b0f4d25e171..d0733d5f2ae 100644 --- a/src/DynamoCoreWpf/Properties/Resources.Designer.cs +++ b/src/DynamoCoreWpf/Properties/Resources.Designer.cs @@ -7674,7 +7674,7 @@ public static string PreferencesViewShowPreviewBubbles { } /// - /// Looks up a localized string similar to Switchable only when the current workspace is in Manual run mode.. + /// Looks up a localized string similar to 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.. /// public static string PreferencesViewShowRunPreviewTooltip { get { diff --git a/src/DynamoCoreWpf/Properties/Resources.en-US.resx b/src/DynamoCoreWpf/Properties/Resources.en-US.resx index f613a2b56c2..6782d49f36b 100644 --- a/src/DynamoCoreWpf/Properties/Resources.en-US.resx +++ b/src/DynamoCoreWpf/Properties/Resources.en-US.resx @@ -2589,7 +2589,7 @@ Do you wish to uninstall {1}? Restart {2} to complete the uninstall and try down Package/Library Search Paths - Switchable only when the current workspace is in Manual run mode. + 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. Issues found diff --git a/src/DynamoCoreWpf/Properties/Resources.resx b/src/DynamoCoreWpf/Properties/Resources.resx index cc366e0db1b..2ce4d6a40a7 100644 --- a/src/DynamoCoreWpf/Properties/Resources.resx +++ b/src/DynamoCoreWpf/Properties/Resources.resx @@ -2877,7 +2877,7 @@ Do you wish to uninstall {1}? Restart {2} to complete the uninstall and try down Package/Library Search Paths - Switchable only when the current workspace is in Manual run mode. + 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. Issues found