From 6bebce481e0a4dab460250cf0ea7714c62308c7b Mon Sep 17 00:00:00 2001 From: tanga Date: Mon, 8 Aug 2022 23:23:48 -0400 Subject: [PATCH 1/5] Initial Commit --- .../Configuration/PreferenceSettings.cs | 6 ++ .../Controls/ShortcutToolbar.xaml | 67 +++++++++++-------- .../Properties/Resources.Designer.cs | 9 +++ .../Properties/Resources.en-US.resx | 3 + src/DynamoCoreWpf/Properties/Resources.resx | 3 + src/DynamoCoreWpf/UI/Converters.cs | 2 - .../UI/GuidedTour/GuidesManager.cs | 1 + .../ViewModels/Menu/PreferencesViewModel.cs | 62 ++++++++--------- .../Views/Menu/PreferencesView.xaml | 37 ++++++++-- .../NotificationCenterController.cs | 54 +++++++++------ src/Notifications/Notifications.csproj | 8 +-- .../Properties/Resources.Designer.cs | 9 +++ .../Properties/Resources.en-US.resx | 3 + src/Notifications/Properties/Resources.resx | 3 + .../Configuration/PreferenceSettingsTests.cs | 4 ++ 15 files changed, 176 insertions(+), 95 deletions(-) diff --git a/src/DynamoCore/Configuration/PreferenceSettings.cs b/src/DynamoCore/Configuration/PreferenceSettings.cs index 70cc167eaa6..b7b24ccf6e7 100644 --- a/src/DynamoCore/Configuration/PreferenceSettings.cs +++ b/src/DynamoCore/Configuration/PreferenceSettings.cs @@ -439,6 +439,11 @@ public string PythonTemplateFilePath /// public bool EnableNodeAutoComplete { get; set; } + /// + /// This defines if user wants to see the enabled Dynamo Notification Center. + /// + public bool EnableNotificationCenter { get; set; } + /// /// Engine used by default for new Python script and string nodes. If not empty, this takes precedence over any system settings. /// @@ -626,6 +631,7 @@ public PreferenceSettings() IsIronPythonDialogDisabled = false; ShowTabsAndSpacesInScriptEditor = false; EnableNodeAutoComplete = true; + EnableNotificationCenter = true; DefaultPythonEngine = string.Empty; ViewExtensionSettings = new List(); GroupStyleItemsList = new List(); diff --git a/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml b/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml index 47f818dc17d..8ae56abb0e8 100644 --- a/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml +++ b/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml @@ -140,34 +140,6 @@ - - - - - + + + + + - + diff --git a/src/DynamoCoreWpf/Properties/Resources.Designer.cs b/src/DynamoCoreWpf/Properties/Resources.Designer.cs index 73293239dc5..21fdceaf476 100644 --- a/src/DynamoCoreWpf/Properties/Resources.Designer.cs +++ b/src/DynamoCoreWpf/Properties/Resources.Designer.cs @@ -6256,6 +6256,15 @@ public static string PreferencesViewEnableNodeAutoCompleteTooltipText { } } + /// + /// Looks up a localized string similar to Notification Center. + /// + public static string PreferencesViewEnableNotificationCenter { + get { + return ResourceManager.GetString("PreferencesViewEnableNotificationCenter", resourceCulture); + } + } + /// /// Looks up a localized string similar to Enable T-Spline nodes. /// diff --git a/src/DynamoCoreWpf/Properties/Resources.en-US.resx b/src/DynamoCoreWpf/Properties/Resources.en-US.resx index 942c6ac484c..1586f7e2d6b 100644 --- a/src/DynamoCoreWpf/Properties/Resources.en-US.resx +++ b/src/DynamoCoreWpf/Properties/Resources.en-US.resx @@ -3270,4 +3270,7 @@ You can manage this in Preferences -> Security. Dynamo cannot ungroup when there is no parent group. + + Notification Center + \ No newline at end of file diff --git a/src/DynamoCoreWpf/Properties/Resources.resx b/src/DynamoCoreWpf/Properties/Resources.resx index 960983a281e..ed8c227345d 100644 --- a/src/DynamoCoreWpf/Properties/Resources.resx +++ b/src/DynamoCoreWpf/Properties/Resources.resx @@ -3257,4 +3257,7 @@ You can manage this in Preferences -> Security. Dynamo cannot ungroup when there is no parent group. + + Notification Center + \ No newline at end of file diff --git a/src/DynamoCoreWpf/UI/Converters.cs b/src/DynamoCoreWpf/UI/Converters.cs index 78db6e32d8b..876f6853f2d 100644 --- a/src/DynamoCoreWpf/UI/Converters.cs +++ b/src/DynamoCoreWpf/UI/Converters.cs @@ -24,8 +24,6 @@ using Dynamo.Wpf.Properties; using Dynamo.Wpf.ViewModels; using DynamoUnits; -using PythonNodeModels; -using SharpDX.DXGI; using Color = System.Windows.Media.Color; using FlowDirection = System.Windows.FlowDirection; using HorizontalAlignment = System.Windows.HorizontalAlignment; diff --git a/src/DynamoCoreWpf/UI/GuidedTour/GuidesManager.cs b/src/DynamoCoreWpf/UI/GuidedTour/GuidesManager.cs index 0dbff9de071..2dca55cd6e6 100644 --- a/src/DynamoCoreWpf/UI/GuidedTour/GuidesManager.cs +++ b/src/DynamoCoreWpf/UI/GuidedTour/GuidesManager.cs @@ -516,6 +516,7 @@ private void Popup_StepClosed(string name, Step.StepTypes stepType) /// and display message passed as param /// /// The target content to display. + /// boolean indicates if the popup will stay open untill user dismiss it. /// TODO: Make this API out of guide manager to a more generic place internal void CreateRealTimeInfoWindow(string content, bool stayOpen = false) { diff --git a/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs b/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs index 496d848c006..71cc86788be 100644 --- a/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs @@ -36,6 +36,14 @@ public class PreferencesViewModel : ViewModelBase, INotifyPropertyChanged #region Private Properties private string savedChangesLabel; private string savedChangesTooltip; + private string currentWarningMessage; + private string selectedPackagePathForInstall; + + private string selectedLanguage; + private string selectedFontSize; + private string selectedNumberFormat; + private string selectedPythonEngine; + private ObservableCollection languagesList; private ObservableCollection packagePathsForInstall; private ObservableCollection fontSizeList; @@ -43,35 +51,20 @@ public class PreferencesViewModel : ViewModelBase, INotifyPropertyChanged private StyleItem addStyleControl; private ObservableCollection pythonEngineList; - private string selectedLanguage; - private string selectedFontSize; - private string selectedNumberFormat; - private string selectedPythonEngine; - private bool runPreviewEnabled; - private bool runPreviewIsChecked; - private bool hideIronPAlerts; - private bool showWhitespace; - private bool nodeAutocomplete; - private bool enableTSpline; - private bool showEdges; - private bool isolateSelectedGeometry; - private bool showCodeBlockLineNumber; private RunType runSettingsIsChecked; private Dictionary preferencesTabs; - private PreferenceSettings preferenceSettings; - private DynamoPythonScriptEditorTextOptions pythonScriptEditorTextOptions; - private HomeWorkspaceModel homeSpace; - private DynamoViewModel dynamoViewModel; + private readonly PreferenceSettings preferenceSettings; + private readonly DynamoPythonScriptEditorTextOptions pythonScriptEditorTextOptions; + private readonly DynamoViewModel dynamoViewModel; + private readonly InstalledPackagesViewModel installedPackagesViewModel; + private bool isWarningEnabled; - private string currentWarningMessage; private bool isSaveButtonEnabled = true; - private GeometryScalingOptions optionsGeometryScale = null; - - private InstalledPackagesViewModel installedPackagesViewModel; - private string selectedPackagePathForInstall; private bool isVisibleAddStyleBorder; private bool isEnabledAddStyleButton; + private GeometryScalingOptions optionsGeometryScale = null; + #endregion Private Properties public GeometryScaleSize ScaleSize { get; set; } @@ -536,7 +529,6 @@ public bool ShowEdges } set { - showEdges = value; dynamoViewModel.RenderPackageFactoryViewModel.ShowEdges = value; RaisePropertyChanged(nameof(ShowEdges)); } @@ -553,7 +545,6 @@ public bool IsolateSelectedGeometry } set { - isolateSelectedGeometry = value; dynamoViewModel.BackgroundPreviewViewModel.IsolationMode = value; RaisePropertyChanged(nameof(IsolateSelectedGeometry)); } @@ -603,7 +594,6 @@ public bool ShowCodeBlockLineNumber set { preferenceSettings.ShowCodeBlockLineNumber = value; - showCodeBlockLineNumber = value; RaisePropertyChanged(nameof(ShowCodeBlockLineNumber)); } } @@ -697,7 +687,6 @@ public bool HideIronPythonAlertsIsChecked } set { - hideIronPAlerts = value; preferenceSettings.IsIronPythonDialogDisabled = value; RaisePropertyChanged(nameof(HideIronPythonAlertsIsChecked)); } @@ -716,7 +705,6 @@ public bool ShowWhitespaceIsChecked { pythonScriptEditorTextOptions.ShowWhiteSpaceCharacters(value); preferenceSettings.ShowTabsAndSpacesInScriptEditor = value; - showWhitespace = value; RaisePropertyChanged(nameof(ShowWhitespaceIsChecked)); } } @@ -733,11 +721,26 @@ public bool NodeAutocompleteIsChecked set { preferenceSettings.EnableNodeAutoComplete = value; - nodeAutocomplete = value; RaisePropertyChanged(nameof(NodeAutocompleteIsChecked)); } } + /// + /// Controls the IsChecked property in the "Notification Center" toogle button + /// + public bool NotificationCenterIsChecked + { + get + { + return preferenceSettings.EnableNotificationCenter; + } + set + { + preferenceSettings.EnableNotificationCenter = value; + RaisePropertyChanged(nameof(NotificationCenterIsChecked)); + } + } + /// /// Controls the IsChecked property in the "Enable T-spline nodes" toogle button /// @@ -750,7 +753,6 @@ public bool EnableTSplineIsChecked } set { - enableTSpline = value; HideUnhideNamespace(!value, "ProtoGeometry.dll", "Autodesk.DesignScript.Geometry.TSpline"); RaisePropertyChanged(nameof(EnableTSplineIsChecked)); } @@ -810,8 +812,6 @@ public PreferencesViewModel(DynamoViewModel dynamoViewModel) { this.preferenceSettings = dynamoViewModel.PreferenceSettings; this.pythonScriptEditorTextOptions = dynamoViewModel.PythonScriptEditorTextOptions; - this.runPreviewEnabled = dynamoViewModel.HomeSpaceViewModel.RunSettingsViewModel.RunButtonEnabled; - this.homeSpace = dynamoViewModel.HomeSpace; this.dynamoViewModel = dynamoViewModel; this.installedPackagesViewModel = new InstalledPackagesViewModel(dynamoViewModel, dynamoViewModel.PackageManagerClientViewModel.PackageManagerExtension.PackageLoader); diff --git a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml index 02a517ac281..77bc31191aa 100644 --- a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml +++ b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml @@ -381,6 +381,7 @@ + @@ -449,12 +450,38 @@ - + + + + + + + + + + + + + + + Style="{StaticResource MenuExpanderStyle}" + IsExpanded="{Binding PreferencesTabs[Features].ExpanderActive, Converter={StaticResource ExpandersBindingConverter}, ConverterParameter=ExperimentalExpander}" + Grid.Row="2" + Header="{x:Static p:Resources.PreferencesViewExperimentalLabel}"> diff --git a/src/Notifications/NotificationCenterController.cs b/src/Notifications/NotificationCenterController.cs index 8face2e805b..838c05d37a8 100644 --- a/src/Notifications/NotificationCenterController.cs +++ b/src/Notifications/NotificationCenterController.cs @@ -6,40 +6,42 @@ using System.Windows.Controls.Primitives; using Dynamo.Controls; using Dynamo.Notifications.View; +using Dynamo.ViewModels; namespace Dynamo.Notifications { public class NotificationCenterController { - readonly NotificationUI notificationUIPopup; - readonly DynamoView dynamoView; - readonly Button notificationsButton; + private readonly NotificationUI notificationUIPopup; + private readonly DynamoView dynamoView; + private readonly DynamoViewModel dynamoViewModel; + private readonly Button notificationsButton; private static readonly int notificationPopupHorizontalOffset = -285; private static readonly int notificationPopupVerticalOffset = 10; private static readonly string htmlEmbeddedFile = "Dynamo.Notifications.node_modules._dynamods.notifications_center.build.index.html"; private static readonly string jsEmbeddedFile = "Dynamo.Notifications.node_modules._dynamods.notifications_center.build.index.bundle.js"; + private static readonly string NotificationCenterButtonName = "notificationsButton"; - internal NotificationCenterController(DynamoView dynamoView) + internal NotificationCenterController(DynamoView view) { - var shortcutBar = dynamoView.ShortcutBar; - var notificationsButton = (Button)shortcutBar.FindName("notificationsButton"); + dynamoView = view; + dynamoViewModel = dynamoView.DataContext as DynamoViewModel; + notificationsButton = (Button)view.ShortcutBar.FindName(NotificationCenterButtonName); - notificationUIPopup = new NotificationUI(); - notificationUIPopup.IsOpen = false; - notificationUIPopup.PlacementTarget = notificationsButton; - notificationUIPopup.Placement = PlacementMode.Bottom; - notificationUIPopup.HorizontalOffset = notificationPopupHorizontalOffset; - notificationUIPopup.VerticalOffset = notificationPopupVerticalOffset; - - this.dynamoView = dynamoView; - this.notificationsButton = notificationsButton; - - this.dynamoView.SizeChanged += DynamoView_SizeChanged; - this.dynamoView.LocationChanged += DynamoView_LocationChanged; - this.notificationsButton.Click += NotificationsButton_Click; + dynamoView.SizeChanged += DynamoView_SizeChanged; + dynamoView.LocationChanged += DynamoView_LocationChanged; + notificationsButton.Click += NotificationsButton_Click; + notificationUIPopup = new NotificationUI + { + IsOpen = false, + PlacementTarget = notificationsButton, + Placement = PlacementMode.Bottom, + HorizontalOffset = notificationPopupHorizontalOffset, + VerticalOffset = notificationPopupVerticalOffset + }; notificationUIPopup.webView.EnsureCoreWebView2Async(); notificationUIPopup.webView.CoreWebView2InitializationCompleted += WebView_CoreWebView2InitializationCompleted; } @@ -86,11 +88,19 @@ private void DynamoView_SizeChanged(object sender, SizeChangedEventArgs e) notificationUIPopup.UpdatePopupLocation(); } + // Notification Center button click handler private void NotificationsButton_Click(object sender, RoutedEventArgs e) { - notificationUIPopup.IsOpen = !notificationUIPopup.IsOpen; - if (notificationUIPopup.IsOpen) - notificationUIPopup.webView.Focus(); + if (this.dynamoViewModel.PreferenceSettings.EnableNotificationCenter) + { + notificationUIPopup.IsOpen = !notificationUIPopup.IsOpen; + if (notificationUIPopup.IsOpen) + notificationUIPopup.webView.Focus(); + } + else + { + this.dynamoViewModel.MainGuideManager.CreateRealTimeInfoWindow(Properties.Resources.NotificationCenterDisabledMsg); + } } } } diff --git a/src/Notifications/Notifications.csproj b/src/Notifications/Notifications.csproj index 0f20f382e98..58597e7c69d 100644 --- a/src/Notifications/Notifications.csproj +++ b/src/Notifications/Notifications.csproj @@ -10,12 +10,8 @@ Notifications - - - - - - + + diff --git a/src/Notifications/Properties/Resources.Designer.cs b/src/Notifications/Properties/Resources.Designer.cs index 364524cdd14..e2f02356014 100644 --- a/src/Notifications/Properties/Resources.Designer.cs +++ b/src/Notifications/Properties/Resources.Designer.cs @@ -113,5 +113,14 @@ public static string ExtensionName { return ResourceManager.GetString("ExtensionName", resourceCulture); } } + + /// + /// Looks up a localized string similar to Notification Center feature is disabled. Enable it in preference panel to see latest news.. + /// + public static string NotificationCenterDisabledMsg { + get { + return ResourceManager.GetString("NotificationCenterDisabledMsg", resourceCulture); + } + } } } diff --git a/src/Notifications/Properties/Resources.en-US.resx b/src/Notifications/Properties/Resources.en-US.resx index dc6075d33c0..3a48ae87a65 100644 --- a/src/Notifications/Properties/Resources.en-US.resx +++ b/src/Notifications/Properties/Resources.en-US.resx @@ -135,4 +135,7 @@ Notifications + + Notification Center feature is disabled. Enable it in preference panel to see latest news. + \ No newline at end of file diff --git a/src/Notifications/Properties/Resources.resx b/src/Notifications/Properties/Resources.resx index dc6075d33c0..3a48ae87a65 100644 --- a/src/Notifications/Properties/Resources.resx +++ b/src/Notifications/Properties/Resources.resx @@ -135,4 +135,7 @@ Notifications + + Notification Center feature is disabled. Enable it in preference panel to see latest news. + \ No newline at end of file diff --git a/test/DynamoCoreTests/Configuration/PreferenceSettingsTests.cs b/test/DynamoCoreTests/Configuration/PreferenceSettingsTests.cs index e959b25c0b2..1db0f8544df 100644 --- a/test/DynamoCoreTests/Configuration/PreferenceSettingsTests.cs +++ b/test/DynamoCoreTests/Configuration/PreferenceSettingsTests.cs @@ -59,6 +59,7 @@ public void TestSettingsSerialization() Assert.AreEqual(settings.IsIronPythonDialogDisabled, false); Assert.AreEqual(settings.ShowTabsAndSpacesInScriptEditor, false); Assert.AreEqual(settings.EnableNodeAutoComplete, true); + Assert.AreEqual(settings.EnableNotificationCenter, true); Assert.AreEqual(settings.DefaultPythonEngine, string.Empty); Assert.AreEqual(settings.MaxNumRecentFiles, PreferenceSettings.DefaultMaxNumRecentFiles); Assert.AreEqual(settings.ViewExtensionSettings.Count, 0); @@ -74,6 +75,7 @@ public void TestSettingsSerialization() Assert.AreEqual(settings.IsIronPythonDialogDisabled, false); Assert.AreEqual(settings.ShowTabsAndSpacesInScriptEditor, false); Assert.AreEqual(settings.EnableNodeAutoComplete, true); + Assert.AreEqual(settings.EnableNotificationCenter, true); Assert.AreEqual(settings.DefaultPythonEngine, string.Empty); Assert.AreEqual(settings.MaxNumRecentFiles, PreferenceSettings.DefaultMaxNumRecentFiles); Assert.AreEqual(settings.ViewExtensionSettings.Count, 0); @@ -87,6 +89,7 @@ public void TestSettingsSerialization() settings.DefaultPythonEngine = "CP3"; settings.MaxNumRecentFiles = 24; settings.EnableNodeAutoComplete = false; + settings.EnableNotificationCenter = false; settings.DefaultRunType = RunType.Manual; settings.ViewExtensionSettings.Add(new ViewExtensionSettings() { @@ -120,6 +123,7 @@ public void TestSettingsSerialization() Assert.AreEqual(settings.DefaultPythonEngine, "CP3"); Assert.AreEqual(settings.MaxNumRecentFiles, 24); Assert.AreEqual(settings.EnableNodeAutoComplete, false); + Assert.AreEqual(settings.EnableNotificationCenter, false); Assert.AreEqual(settings.ViewExtensionSettings.Count, 1); var extensionSettings = settings.ViewExtensionSettings[0]; Assert.AreEqual(settings.DefaultRunType, RunType.Manual); From 4aff861e62ee0f71fbe3bab951090e7b7f3fa376 Mon Sep 17 00:00:00 2001 From: tanga Date: Tue, 9 Aug 2022 11:21:14 -0400 Subject: [PATCH 2/5] Add comment --- src/Notifications/NotificationCenterController.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Notifications/NotificationCenterController.cs b/src/Notifications/NotificationCenterController.cs index 838c05d37a8..03b528b6ba1 100644 --- a/src/Notifications/NotificationCenterController.cs +++ b/src/Notifications/NotificationCenterController.cs @@ -88,7 +88,11 @@ private void DynamoView_SizeChanged(object sender, SizeChangedEventArgs e) notificationUIPopup.UpdatePopupLocation(); } - // Notification Center button click handler + /// + /// Notification Center button click handler + /// + /// + /// private void NotificationsButton_Click(object sender, RoutedEventArgs e) { if (this.dynamoViewModel.PreferenceSettings.EnableNotificationCenter) From bfffc9dc66adaf76c8e96df58e2d7431efc9f082 Mon Sep 17 00:00:00 2001 From: tanga Date: Tue, 9 Aug 2022 16:48:26 -0400 Subject: [PATCH 3/5] Updates --- .../Configuration/PreferenceSettings.cs | 14 +++++++++++++- .../Controls/ShortcutToolbar.xaml | 15 ++++++++------- .../Properties/Resources.Designer.cs | 11 ++++++++++- .../Properties/Resources.en-US.resx | 5 +++++ src/DynamoCoreWpf/Properties/Resources.resx | 5 +++++ src/DynamoCoreWpf/UI/Converters.cs | 18 ++++++++++++++++++ .../UI/Themes/Modern/DynamoConverters.xaml | 1 + .../Views/Menu/PreferencesView.xaml | 2 +- .../PackageManagerViewExtension.cs | 2 +- 9 files changed, 62 insertions(+), 11 deletions(-) diff --git a/src/DynamoCore/Configuration/PreferenceSettings.cs b/src/DynamoCore/Configuration/PreferenceSettings.cs index b7b24ccf6e7..43619a41288 100644 --- a/src/DynamoCore/Configuration/PreferenceSettings.cs +++ b/src/DynamoCore/Configuration/PreferenceSettings.cs @@ -27,6 +27,7 @@ public class PreferenceSettings : NotificationObject, IPreferences, IRenderPreci private int maxNumRecentFiles; private bool isBackgroundGridVisible; private bool disableTrustWarnings = false; + private bool isNotificationCenterEnabled; #region Constants /// /// Indicates the maximum number of files shown in Recent Files @@ -442,7 +443,18 @@ public string PythonTemplateFilePath /// /// This defines if user wants to see the enabled Dynamo Notification Center. /// - public bool EnableNotificationCenter { get; set; } + public bool EnableNotificationCenter + { + get + { + return isNotificationCenterEnabled; + } + set + { + isNotificationCenterEnabled = value; + RaisePropertyChanged(nameof(EnableNotificationCenter)); + } + } /// /// Engine used by default for new Python script and string nodes. If not empty, this takes precedence over any system settings. diff --git a/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml b/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml index 8ae56abb0e8..73b58618a7f 100644 --- a/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml +++ b/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml @@ -189,7 +189,8 @@ - 8 + 8 diff --git a/src/DynamoCoreWpf/Properties/Resources.Designer.cs b/src/DynamoCoreWpf/Properties/Resources.Designer.cs index 21fdceaf476..4ad1aaea7f7 100644 --- a/src/DynamoCoreWpf/Properties/Resources.Designer.cs +++ b/src/DynamoCoreWpf/Properties/Resources.Designer.cs @@ -6257,7 +6257,7 @@ public static string PreferencesViewEnableNodeAutoCompleteTooltipText { } /// - /// Looks up a localized string similar to Notification Center. + /// Looks up a localized string similar to Receive notification. /// public static string PreferencesViewEnableNotificationCenter { get { @@ -6337,6 +6337,15 @@ public static string PreferencesViewMarkdownDirectoryTooltip { } } + /// + /// Looks up a localized string similar to Notification Center. + /// + public static string PreferencesViewNotificationCenter { + get { + return ResourceManager.GetString("PreferencesViewNotificationCenter", resourceCulture); + } + } + /// /// Looks up a localized string similar to New Package Download Path. /// diff --git a/src/DynamoCoreWpf/Properties/Resources.en-US.resx b/src/DynamoCoreWpf/Properties/Resources.en-US.resx index 1586f7e2d6b..92222a5cf5c 100644 --- a/src/DynamoCoreWpf/Properties/Resources.en-US.resx +++ b/src/DynamoCoreWpf/Properties/Resources.en-US.resx @@ -3271,6 +3271,11 @@ You can manage this in Preferences -> Security. Dynamo cannot ungroup when there is no parent group. + Receive notification + Preferences | Features | Notification Center | Receive notification + + Notification Center + Preferences | Features | Notification Center \ No newline at end of file diff --git a/src/DynamoCoreWpf/Properties/Resources.resx b/src/DynamoCoreWpf/Properties/Resources.resx index ed8c227345d..8fe7a5fd581 100644 --- a/src/DynamoCoreWpf/Properties/Resources.resx +++ b/src/DynamoCoreWpf/Properties/Resources.resx @@ -3258,6 +3258,11 @@ You can manage this in Preferences -> Security. Dynamo cannot ungroup when there is no parent group. + Receive notification + Preferences | Features | Notification Center | Receive notification + + Notification Center + Preferences | Features | Notification Center \ No newline at end of file diff --git a/src/DynamoCoreWpf/UI/Converters.cs b/src/DynamoCoreWpf/UI/Converters.cs index 876f6853f2d..d07b1f743db 100644 --- a/src/DynamoCoreWpf/UI/Converters.cs +++ b/src/DynamoCoreWpf/UI/Converters.cs @@ -1298,6 +1298,24 @@ public object ConvertBack(object value, Type targetType, object parameter, Syste } } + /// + /// Converter for Notification Bell updates based on feature enabled or not + /// + public class BoolToFAIconNameConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + if ((bool)value) + return nameof(FontAwesome.WPF.FontAwesomeIcon.BellOutline); + return nameof(FontAwesome.WPF.FontAwesomeIcon.BellSlashOutline); + } + + public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + throw new NotSupportedException(); + } + } + public class BoolToVisibilityConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) diff --git a/src/DynamoCoreWpf/UI/Themes/Modern/DynamoConverters.xaml b/src/DynamoCoreWpf/UI/Themes/Modern/DynamoConverters.xaml index 5cac38032f1..d672e30bc74 100644 --- a/src/DynamoCoreWpf/UI/Themes/Modern/DynamoConverters.xaml +++ b/src/DynamoCoreWpf/UI/Themes/Modern/DynamoConverters.xaml @@ -87,6 +87,7 @@ + diff --git a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml index 77bc31191aa..299c11d97f4 100644 --- a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml +++ b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml @@ -455,7 +455,7 @@ Style="{StaticResource MenuExpanderStyle}" IsExpanded="{Binding PreferencesTabs[Features].ExpanderActive, Converter={StaticResource ExpandersBindingConverter}, ConverterParameter=NotificationCenterExpander}" Grid.Row="1" - Header="{x:Static p:Resources.PreferencesViewEnableNotificationCenter}"> + Header="{x:Static p:Resources.PreferencesViewNotificationCenter}"> diff --git a/src/DynamoPackagesWPF/PackageManagerViewExtension.cs b/src/DynamoPackagesWPF/PackageManagerViewExtension.cs index a3d71c12ad6..488544c593c 100644 --- a/src/DynamoPackagesWPF/PackageManagerViewExtension.cs +++ b/src/DynamoPackagesWPF/PackageManagerViewExtension.cs @@ -125,8 +125,8 @@ private void RequestLoadViewExtensionsForLoadedPackages(IEnumerable pac if (viewExtension != null) { RequestAddExtension?.Invoke(viewExtension); + this.requestedExtensions.Add(viewExtension); } - this.requestedExtensions.Add(viewExtension); } } } From 85ac9688ffa29bfec8842c755ff20df93a15bec9 Mon Sep 17 00:00:00 2001 From: tanga Date: Tue, 9 Aug 2022 17:15:41 -0400 Subject: [PATCH 4/5] Comments --- src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml | 2 +- src/DynamoCoreWpf/UI/GuidedTour/GuidesManager.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml b/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml index 73b58618a7f..7d3f51a2a0c 100644 --- a/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml +++ b/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml @@ -189,7 +189,7 @@ /// The target content to display. - /// boolean indicates if the popup will stay open untill user dismiss it. + /// boolean indicates if the popup will stay open until user dismiss it. /// TODO: Make this API out of guide manager to a more generic place internal void CreateRealTimeInfoWindow(string content, bool stayOpen = false) { From 1f221bfc16ab4f216a212b2f77018e919447b3f9 Mon Sep 17 00:00:00 2001 From: tanga Date: Wed, 10 Aug 2022 01:03:36 -0400 Subject: [PATCH 5/5] Add button tooltip --- src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml | 7 ++++++- src/DynamoCoreWpf/Properties/Resources.Designer.cs | 9 +++++++++ src/DynamoCoreWpf/Properties/Resources.en-US.resx | 3 +++ src/DynamoCoreWpf/Properties/Resources.resx | 3 +++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml b/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml index 7d3f51a2a0c..1067d31ce15 100644 --- a/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml +++ b/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml @@ -185,7 +185,12 @@ + public static string NotificationCenterButtonTooltip { + get { + return ResourceManager.GetString("NotificationCenterButtonTooltip", resourceCulture); + } + } + /// /// Looks up a localized string similar to null. /// diff --git a/src/DynamoCoreWpf/Properties/Resources.en-US.resx b/src/DynamoCoreWpf/Properties/Resources.en-US.resx index 92222a5cf5c..a3937847607 100644 --- a/src/DynamoCoreWpf/Properties/Resources.en-US.resx +++ b/src/DynamoCoreWpf/Properties/Resources.en-US.resx @@ -3278,4 +3278,7 @@ You can manage this in Preferences -> Security. Notification Center Preferences | Features | Notification Center + + Click to view latest news from Dynamo Team. + \ No newline at end of file diff --git a/src/DynamoCoreWpf/Properties/Resources.resx b/src/DynamoCoreWpf/Properties/Resources.resx index 8fe7a5fd581..a2256da86fc 100644 --- a/src/DynamoCoreWpf/Properties/Resources.resx +++ b/src/DynamoCoreWpf/Properties/Resources.resx @@ -3265,4 +3265,7 @@ You can manage this in Preferences -> Security. Notification Center Preferences | Features | Notification Center + + Click to view latest news from Dynamo Team. + \ No newline at end of file