Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 18 additions & 0 deletions src/DynamoCore/Configuration/PreferenceSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
/// <summary>
/// Indicates the maximum number of files shown in Recent Files
Expand Down Expand Up @@ -439,6 +440,22 @@ public string PythonTemplateFilePath
/// </summary>
public bool EnableNodeAutoComplete { get; set; }

/// <summary>
/// This defines if user wants to see the enabled Dynamo Notification Center.
/// </summary>
public bool EnableNotificationCenter
{
get
{
return isNotificationCenterEnabled;
}
set
{
isNotificationCenterEnabled = value;
RaisePropertyChanged(nameof(EnableNotificationCenter));
}
}

/// <summary>
/// Engine used by default for new Python script and string nodes. If not empty, this takes precedence over any system settings.
/// </summary>
Expand Down Expand Up @@ -626,6 +643,7 @@ public PreferenceSettings()
IsIronPythonDialogDisabled = false;
ShowTabsAndSpacesInScriptEditor = false;
EnableNodeAutoComplete = true;
EnableNotificationCenter = true;
DefaultPythonEngine = string.Empty;
ViewExtensionSettings = new List<ViewExtensionSettings>();
GroupStyleItemsList = new List<GroupStyleItem>();
Expand Down
73 changes: 44 additions & 29 deletions src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,34 +140,6 @@
<Menu HorizontalAlignment="Right"
Style="{StaticResource MainMenu}"
IsMainMenu="True">
<MenuItem Name="MenuItem"
Margin="0 0 -30 0">
<MenuItem.Header>
<Button x:Name="notificationsButton"
BorderBrush="Transparent"
Background="Transparent">
<DockPanel>
<fa:FontAwesome Margin="0,0,20,0"
DockPanel.Dock="Bottom"
Icon="BellOutline"
Foreground="{StaticResource Blue400Brush}"
FontSize="20px"/>
<Border DockPanel.Dock="Top" Background="{StaticResource Blue400Brush}" CornerRadius="2"
Padding="2" Height="15" Width="15" VerticalAlignment="Center"
HorizontalAlignment="Center">
<!--TODO insert data bind for the notifications -->
<TextBlock
FontFamily="{StaticResource ArtifaktElementRegular}"
Foreground="White"
FontWeight="Bold"
TextAlignment="Center"
FontSize="9">99
</TextBlock>
</Border>
</DockPanel>
</Button>
</MenuItem.Header>
</MenuItem>
<MenuItem Name="exportMenu"
Cursor="Hand"
Focusable="False"
Expand Down Expand Up @@ -208,8 +180,51 @@
</MenuItem.ToolTip>
</MenuItem>
</MenuItem>
<MenuItem Name="NotificationCenter"
Margin="-15 0 -30 0">
<MenuItem.Header>
<Button x:Name="notificationsButton"
BorderBrush="Transparent"
BorderThickness="0"
Background="Transparent"
Cursor="Hand">
<Button.ToolTip>
<ToolTip Content="{x:Static p:Resources.NotificationCenterButtonTooltip}" Style="{StaticResource GenericToolTipLight}" />
</Button.ToolTip>
<DockPanel>
<fa:FontAwesome Margin="0,0,25,0"
DockPanel.Dock="Top"
Icon="{Binding Path=DataContext.PreferenceSettings.EnableNotificationCenter, RelativeSource={RelativeSource AncestorType={x:Type Window}},
Converter={StaticResource BoolToFAIconNameConverter}}"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Foreground="{StaticResource PrimaryCharcoal300Brush}"
FontSize="18px"/>
<Border DockPanel.Dock="Bottom"
Background="{StaticResource Blue400Brush}"
CornerRadius="2"
Padding="2"
Height="14"
Width="14"
VerticalAlignment="Center"
HorizontalAlignment="Center">
<!--TODO insert data bind for the notifications -->
<TextBlock Name="NotificationCount"
FontFamily="{StaticResource ArtifaktElementRegular}"
Foreground="White"
FontWeight="DemiBold"
TextAlignment="Center"
FontSize="9">8
</TextBlock>
</Border>
</DockPanel>
</Button>
</MenuItem.Header>
</MenuItem>
</Menu>
<controls:GraphUpdateNotificationControl x:Name="UpdateControl" HorizontalAlignment="Right"
<!--The update indication-->
<controls:GraphUpdateNotificationControl x:Name="UpdateControl"
HorizontalAlignment="Right"
Margin="0,0,50,0"
Visibility="{Binding Path=DataContext.IsUpdateAvailable, RelativeSource={RelativeSource AncestorType={x:Type Window}},
Converter={StaticResource BooleanToVisibilityCollapsedConverter}}"/>
Expand Down
27 changes: 27 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.Designer.cs

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

11 changes: 11 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -3270,4 +3270,15 @@ You can manage this in Preferences -&gt; Security.</value>
<data name="UngroupParentGroupWarning" xml:space="preserve">
<value>Dynamo cannot ungroup when there is no parent group.</value>
</data>
<data name="PreferencesViewEnableNotificationCenter" xml:space="preserve">
<value>Receive notification</value>
<comment>Preferences | Features | Notification Center | Receive notification</comment>
</data>
<data name="PreferencesViewNotificationCenter" xml:space="preserve">
<value>Notification Center</value>
<comment>Preferences | Features | Notification Center</comment>
</data>
<data name="NotificationCenterButtonTooltip" xml:space="preserve">
<value>Click to view latest news from Dynamo Team.</value>
</data>
</root>
11 changes: 11 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -3257,4 +3257,15 @@ You can manage this in Preferences -&gt; Security.</value>
<data name="UngroupParentGroupWarning" xml:space="preserve">
<value>Dynamo cannot ungroup when there is no parent group.</value>
</data>
<data name="PreferencesViewEnableNotificationCenter" xml:space="preserve">
<value>Receive notification</value>
<comment>Preferences | Features | Notification Center | Receive notification</comment>
</data>
<data name="PreferencesViewNotificationCenter" xml:space="preserve">
<value>Notification Center</value>
<comment>Preferences | Features | Notification Center</comment>
</data>
<data name="NotificationCenterButtonTooltip" xml:space="preserve">
<value>Click to view latest news from Dynamo Team.</value>
</data>
</root>
20 changes: 18 additions & 2 deletions src/DynamoCoreWpf/UI/Converters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1300,6 +1298,24 @@ public object ConvertBack(object value, Type targetType, object parameter, Syste
}
}

/// <summary>
/// Converter for Notification Bell updates based on feature enabled or not
/// </summary>
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)
Expand Down
1 change: 1 addition & 0 deletions src/DynamoCoreWpf/UI/GuidedTour/GuidesManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ private void Popup_StepClosed(string name, Step.StepTypes stepType)
/// and display message passed as param
/// </summary>
/// <param name="content">The target content to display.</param>
/// <param name="stayOpen">boolean indicates if the popup will stay open until user dismiss it.</param>
/// TODO: Make this API out of guide manager to a more generic place
internal void CreateRealTimeInfoWindow(string content, bool stayOpen = false)
{
Expand Down
1 change: 1 addition & 0 deletions src/DynamoCoreWpf/UI/Themes/Modern/DynamoConverters.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
<controls:LacingToTooltipConverter x:Key="LacingToTooltipConverter" />
<controls:NodeWarningConverter x:Key="NodeWarningConverter"/>
<controls:NodeOriginalNameToMarginConverter x:Key="NodeOriginalNameToMarginConverter" />
<controls:BoolToFAIconNameConverter x:Key="BoolToFAIconNameConverter" />
<controls:BoolToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<controls:BoolToVisibilityCollapsedConverter x:Key="BooleanToVisibilityCollapsedConverter" />
<controls:InverseBooleanToVisibilityCollapsedConverter x:Key="InverseBoolToVisibilityCollapsedConverter" />
Expand Down
Loading