Skip to content

Commit

Permalink
Merge branch 'master' into DropDownPopulation
Browse files Browse the repository at this point in the history
  • Loading branch information
QilongTang committed Dec 6, 2023
2 parents 3142ddd + af792ae commit c9c8db5
Show file tree
Hide file tree
Showing 16 changed files with 82 additions and 304 deletions.
24 changes: 9 additions & 15 deletions src/DynamoCoreWpf/Controls/InstalledPackagesControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,10 @@
GroupName="PackageFilters"
IsChecked="{Binding Path=IsChecked, Mode=TwoWay}"
Style="{StaticResource {x:Type ToggleButton}}"
FontSize="11"
FontSize="10"
FontFamily="Artifakt Element"
FontWeight="Medium"
HorizontalAlignment="Center"
VerticalAlignment="Center"
VerticalContentAlignment="Center"
BorderThickness="1"
BorderBrush="Transparent"
UseLayoutRounding="True"
Expand Down Expand Up @@ -123,7 +121,7 @@
</TextBlock>
<TextBlock Text="{Binding Path=Model.VersionName}"
MinWidth="70"
FontSize="12"
FontSize="11"
VerticalAlignment="Center"
Foreground="{StaticResource PreferencesWindowFontColor}"></TextBlock>

Expand Down Expand Up @@ -257,8 +255,7 @@
<DataTemplate>
<TextBlock Text="{Binding Path=Name}"
Foreground="{StaticResource PreferencesWindowFontColor}"
FontSize="11"
FontWeight="Regular"
FontSize="9"
TextTrimming="CharacterEllipsis" />
</DataTemplate>
</ItemsControl.ItemTemplate>
Expand All @@ -282,8 +279,7 @@
<TextBlock Name="Label"
Text="{Binding Path=Name}"
Foreground="{StaticResource PreferencesWindowFontColor}"
FontSize="11"
FontWeight="Regular"
FontSize="9"
TextTrimming="CharacterEllipsis" />

<DataTemplate.Triggers>
Expand Down Expand Up @@ -316,8 +312,7 @@
<TextBlock Name="Label"
Text="{Binding Path=Name}"
Foreground="{StaticResource PreferencesWindowFontColor}"
FontSize="11"
FontWeight="Regular"
FontSize="9"
TextTrimming="CharacterEllipsis" />

<DataTemplate.Triggers>
Expand All @@ -339,7 +334,7 @@
Margin="0,0,0,5">

<Label Content="{x:Static p:Resources.InstalledPackageViewAdditionalFileLabel}"
FontSize="12"
FontSize="11"
Padding="0,5,5,5"
Foreground="{StaticResource PreferencesWindowFontColor}"></Label>
<ItemsControl Name="AdditionalFiles"
Expand All @@ -349,10 +344,9 @@
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=RelativePath}"
Foreground="{StaticResource PreferencesWindowFontColor}"
FontSize="12"
FontWeight="Regular"
TextTrimming="CharacterEllipsis" />
Foreground="{StaticResource PreferencesWindowFontColor}"
FontSize="9"
TextTrimming="CharacterEllipsis" />
</DataTemplate>
</ItemsControl.ItemTemplate>

Expand Down
11 changes: 1 addition & 10 deletions src/DynamoCoreWpf/Properties/Resources.Designer.cs

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

7 changes: 2 additions & 5 deletions src/DynamoCoreWpf/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,7 @@ Failed to publish file(s):
<value>Library</value>
</data>
<data name="MajorVersionNonNegative" xml:space="preserve">
<value>You must provide a Major version as a non-negative integer.</value>
<value>Provide major, minor, and build version number.</value>
<comment>ErrorString</comment>
</data>
<data name="Manual" xml:space="preserve">
Expand Down Expand Up @@ -3612,9 +3612,6 @@ You can manage this in Preferences -&gt; Security.</value>
<data name="PackageDeprecatedTooltip" xml:space="preserve">
<value>This package is outdated and cannot be installed.</value>
</data>
<data name="PackageManagerMyPackagesPublishVersion" xml:space="preserve">
<value>Publish Version</value>
</data>
<data name="SplashScreenViewExtensions" xml:space="preserve">
<value>Loading View Extensions...</value>
</data>
Expand Down Expand Up @@ -3858,4 +3855,4 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in
<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>
</data>
</root>
</root>
7 changes: 2 additions & 5 deletions src/DynamoCoreWpf/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1776,7 +1776,7 @@ Note: Incorrect folder structure may affect the functionality of packages that r
<comment>ErrorString</comment>
</data>
<data name="MajorVersionNonNegative" xml:space="preserve">
<value>You must provide a Major version as a non-negative integer.</value>
<value>Provide major, minor, and build version number.</value>
<comment>ErrorString</comment>
</data>
<data name="MinorVersionNonNegative" xml:space="preserve">
Expand Down Expand Up @@ -3599,9 +3599,6 @@ You can manage this in Preferences -&gt; Security.</value>
<data name="PackageDeprecatedTooltip" xml:space="preserve">
<value>This package is outdated and cannot be installed.</value>
</data>
<data name="PackageManagerMyPackagesPublishVersion" xml:space="preserve">
<value>Publish Version</value>
</data>
<data name="SplashScreenViewExtensions" xml:space="preserve">
<value>Loading View Extensions...</value>
</data>
Expand Down Expand Up @@ -3845,4 +3842,4 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in
<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>
</data>
</root>
</root>
19 changes: 5 additions & 14 deletions src/DynamoCoreWpf/UI/Themes/Modern/DynamoModern.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
<Color x:Key="DefaultBorderBrushDarkColor">Black</Color>
<Color x:Key="GenericMouseOverBackgroundColor">#808080</Color>

<SolidColorBrush x:Key="BorderPressedColorBrush" Color="{DynamicResource BorderPressedColor}"/>
<SolidColorBrush x:Key="GenericBorderBackgroundColorBrush" Color="#3c3c3c"/>
<SolidColorBrush x:Key="GenericMouseOverBackgroundColorBrush" Color="{DynamicResource GenericMouseOverBackgroundColor}"/>

Expand Down Expand Up @@ -1023,7 +1022,7 @@
<Setter Property="CaretBrush" Value="{StaticResource PrimaryCharcoal200Brush}" />
<Setter Property="Padding" Value="10,12,10,8"/>
<Setter Property="FontFamily" Value="{StaticResource ArtifaktElementRegular}"/>
<Setter Property="FontSize" Value="14px" />
<Setter Property="FontSize" Value="12px" />
<Setter Property="Foreground" Value="{StaticResource PrimaryCharcoal200Brush}"/>
<Setter Property="TextWrapping" Value="Wrap"/>

Expand Down Expand Up @@ -3422,19 +3421,11 @@
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid>
<Border Width="16" Height="16" Background="Transparent" BorderThickness="0">
<Path Name="menuIcon"
Width="16"
Height="16"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Fill="{DynamicResource MidGreyBrush}"
Data="M7.5 3C8.32843 3 9 2.32843 9 1.5C9 0.671573 8.32843 0 7.5 0C6.67157 0 6 0.671573 6 1.5C6 2.32843 6.67157 3 7.5 3ZM7.5 9C8.32843 9 9 8.32843 9 7.5C9 6.67157 8.32843 6 7.5 6C6.67157 6 6 6.67157 6 7.5C6 8.32843 6.67157 9 7.5 9ZM9 13.5C9 14.3284 8.32843 15 7.5 15C6.67157 15 6 14.3284 6 13.5C6 12.6716 6.67157 12 7.5 12C8.32843 12 9 12.6716 9 13.5Z"/>
</Border>
<Image Name="menuIcon" Width="16" Height="16" Source="pack://application:,,,/DynamoCoreWpf;component/UI/Images/menu_16_16.png"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="menuIcon" Property="Fill" Value="{DynamicResource BorderPressedColorBrush}" />
<Setter TargetName="menuIcon" Property="Source" Value="pack://application:,,,/DynamoCoreWpf;component/UI/Images/menu-hover-16px.png" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value=".5" />
Expand All @@ -3443,7 +3434,7 @@
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Style>

<Style x:Key="CtaButtonStyle" TargetType="Button">
<Setter Property="HorizontalAlignment" Value="Right" />
Expand Down Expand Up @@ -4251,7 +4242,7 @@

<Style x:Key="PackageManagerTab" TargetType="{x:Type TabItem}">
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="FontSize" Value="14" />
<Setter Property="FontSize" Value="15" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
Expand Down
4 changes: 3 additions & 1 deletion src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
using Dynamo.Graph.Nodes;
using Dynamo.Graph.Workspaces;
using Dynamo.Interfaces;
using Dynamo.Logging;
using Dynamo.Models;
using Dynamo.PackageManager;
using Dynamo.PackageManager.UI;
Expand Down Expand Up @@ -1879,7 +1880,8 @@ private void model_ComputeModelDeserialized()
/// <param name="notification"></param>
private void model_RequestNotification(string notification, bool stayOpen = false)
{
this.MainGuideManager.CreateRealTimeInfoWindow(notification, stayOpen);
this.MainGuideManager?.CreateRealTimeInfoWindow(notification, stayOpen);
model?.Logger?.Log(notification);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,24 +113,6 @@ public PackageManagerSearchElementViewModel(PackageManagerSearchElement element,
public PackageManagerSearchElementViewModel(PackageManagerSearchElement element, bool canLogin) : this(element, canLogin, true)
{}

/// <summary>
/// A property showing if the currently logged-in user owns the package
/// </summary>
private bool isOwner = false;
public bool IsOnwer
{
get
{
return isOwner;
}

internal set
{
isOwner = value;
RaisePropertyChanged(nameof(IsOnwer));
}
}

private bool canInstall;
/// <summary>
/// A Boolean flag reporting whether or not the user can install this SearchElement's package.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,12 +651,8 @@ private void PopulateMyPackages()
var pkgs = PackageManagerClientViewModel.CachedPackageList.Where(x => x.Maintainers != null && x.Maintainers.Contains(name)).ToList();
foreach(var pkg in pkgs)
{
var p = new PackageManagerSearchElementViewModel(pkg,
PackageManagerClientViewModel.AuthenticationManager.HasAuthProvider,
CanInstallPackage(pkg.Name));
var p = new PackageManagerSearchElementViewModel(pkg, false);
p.RequestDownload += this.PackageOnExecuted;
p.RequestShowFileDialog += this.OnRequestShowFileDialog;
p.IsOnwer = true;

myPackages.Add(p);
}
Expand All @@ -670,7 +666,6 @@ private void ClearMySearchResults()
foreach (var ele in this.SearchMyResults)
{
ele.RequestDownload -= PackageOnExecuted;
ele.RequestShowFileDialog -= OnRequestShowFileDialog;
}

this.SearchMyResults = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System;
using System.Collections.ObjectModel;
using System.Linq;
using Dynamo.PackageManager.ViewModels;
using Dynamo.UI.Commands;
using Dynamo.ViewModels;
using NotificationObject = Dynamo.Core.NotificationObject;

Expand All @@ -28,20 +25,7 @@ public class PackageManagerViewModel : NotificationObject, IDisposable
/// <summary>
/// PublishPackageViewModel containing information about all the published packages
/// </summary>
///
private PublishPackageViewModel publishPackageViewModel;
public PublishPackageViewModel PublishPackageViewModel
{
get { return publishPackageViewModel; }
set
{
if (publishPackageViewModel != value)
{
publishPackageViewModel = value;
RaisePropertyChanged(nameof(PublishPackageViewModel));
}
}
}
public PublishPackageViewModel PublishPackageViewModel { get; set; }

/// <summary>
/// Returns all installed packages
Expand All @@ -53,7 +37,6 @@ public PublishPackageViewModel PublishPackageViewModel
/// </summary>
public ObservableCollection<PackageFilter> Filters => installedPackagesViewModel.Filters;

public DelegateCommand PublishNewVersionCommand { get; set; }

//Width of the PackageManagerView the default value is 1076
public double Width
Expand Down Expand Up @@ -107,21 +90,6 @@ public PackageManagerViewModel(DynamoViewModel dynamoViewModel, PackageManagerSe
{
PreferencesViewModel.SelectedPackagePathForInstall = dynamoViewModel.PreferenceSettings.SelectedPackagePathForInstall;
}

PublishNewVersionCommand = new DelegateCommand(PublishNewPackageVersionRelayCommand);
}


private void PublishNewPackageVersionRelayCommand(object obj)
{
var searchElement = obj as PackageManagerSearchElementViewModel;
if(searchElement != null)
{
var localPackage = LocalPackages.First(x => x.Model.Name.Equals(searchElement.Name));

if (localPackage == null) { return; }
localPackage.PublishNewPackageVersionCommand.Execute();
}
}

private void LocalPackages_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
Expand Down Expand Up @@ -93,7 +92,7 @@ public DynamoViewModel DynamoViewModel
/// <summary>
/// Package Publish entry, binded to the host multi-selection option
/// </summary>
public class HostComboboxEntry : NotificationObject
public class HostComboboxEntry
{
/// <summary>
/// Name of the host
Expand All @@ -103,19 +102,7 @@ public class HostComboboxEntry : NotificationObject
/// <summary>
/// Boolean indicates if the host entry is selected
/// </summary>
private bool _isSelected;
public bool IsSelected
{
get { return _isSelected; }
set
{
if (_isSelected != value)
{
_isSelected = value;
RaisePropertyChanged(nameof(IsSelected));
}
}
}
public bool IsSelected { get; set; }

/// <summary>
/// Constructor
Expand Down Expand Up @@ -203,7 +190,6 @@ public bool IsNewVersion
{
_isNewVersion = value;
RaisePropertyChanged("IsNewVersion");
RaisePropertyChanged("CanEditName");
}
}
}
Expand Down Expand Up @@ -1122,9 +1108,8 @@ private void ClearAllEntries()
this.AdditionalFiles = new ObservableCollection<string>();
this.Dependencies = new ObservableCollection<PackageDependency>();
this.Assemblies = new List<PackageAssembly>();
this.KnownHosts.ForEach(host => { host.IsSelected = false; });
this.SelectedHostsString = string.Empty;
this.SelectedHosts = new List<String>();
this.SelectedHostsString = string.Empty;
this.copyrightHolder = string.Empty;
this.copyrightYear = string.Empty;
this.RootFolder = string.Empty;
Expand Down
Loading

0 comments on commit c9c8db5

Please sign in to comment.