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

move package search paths to preferences settings #11762

Merged
merged 25 commits into from
Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2e542ca
add new color for dark backgrounds
mjkkirschner Jun 11, 2021
a37047b
rename style
mjkkirschner Jun 14, 2021
91c87c7
get rid of selected index
mjkkirschner Jun 15, 2021
9952bf2
missed
mjkkirschner Jun 15, 2021
560d207
Merge branch 'master' of https://github.com/DynamoDS/Dynamo into sear…
mjkkirschner Jun 16, 2021
11aefcb
tweak some margins
mjkkirschner Jun 16, 2021
5b59f9e
new icons
mjkkirschner Jun 16, 2021
ea02e3e
expander bigger font
mjkkirschner Jun 16, 2021
4e7925c
change all expander headers to 14pt font, medium
mjkkirschner Jun 16, 2021
768e9f5
add isdisabled helper
mjkkirschner Jun 17, 2021
5530b7c
missed
mjkkirschner Jun 17, 2021
cea771d
fix tooltips
mjkkirschner Jun 17, 2021
f0c149e
add new icons
mjkkirschner Jun 17, 2021
a58d6e8
fix bug
mjkkirschner Jun 17, 2021
e52eb79
update resx
mjkkirschner Jun 17, 2021
5ec29ba
fix the build - typo
mjkkirschner Jun 17, 2021
fdfaca3
obsolete commands for raising old dialogs.
mjkkirschner Jun 18, 2021
8d0b336
missed file
mjkkirschner Jun 18, 2021
242b3b4
remove menu item from debug
mjkkirschner Jun 18, 2021
7fb292c
Merge branch 'master' into searchpathslist
mjkkirschner Jun 21, 2021
6b2a793
two small textblock and label styles
mjkkirschner Jun 21, 2021
e0a9449
Merge branch 'searchpathslist' of https://github.com/mjkkirschner/Dyn…
mjkkirschner Jun 21, 2021
f8752bb
review comments
mjkkirschner Jun 21, 2021
405a5b4
Merge branch 'master' of https://github.com/DynamoDS/Dynamo into sear…
mjkkirschner Jun 21, 2021
b79b617
fix 2 tests
mjkkirschner Jun 22, 2021
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
6 changes: 5 additions & 1 deletion src/DynamoCoreWpf/DynamoCoreWpf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
</Reference>
<Reference Include="ProtoGeometry, Version=2.12.0.5264, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\DynamoVisualProgramming.LibG_227_0_0.2.12.0.5264\lib\net48\ProtoGeometry.dll</HintPath>
<Private>False</Private>
<Private>False</Private>
</Reference>
<Reference Include="RestSharp, Version=105.2.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RestSharp.105.2.3\lib\net46\RestSharp.dll</HintPath>
Expand Down Expand Up @@ -1308,6 +1308,10 @@
<Resource Include="UI\Images\profile_normal.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="UI\Images\PackageManager\close_16_16.png" />
<Resource Include="UI\Images\PackageManager\down_16_16.png" />
<Resource Include="UI\Images\PackageManager\folder_16_16.png" />
<Resource Include="UI\Images\PackageManager\up_16_16.png" />
mjkkirschner marked this conversation as resolved.
Show resolved Hide resolved
<EmbeddedResource Include="Controls\Docs\NodeAutocompleteDocumentation.html" />
<Content Include="sharpdx_direct3d11_effects_x64.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
Expand Down
18 changes: 18 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.

6 changes: 6 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2405,6 +2405,12 @@ Uninstall the following packages: {0}?</value>
<data name="PreferencesPackageManagerSettingsTab" xml:space="preserve">
<value>Package Manager</value>
</data>
<data name="PackagePathAddPathButtonName" xml:space="preserve">
<value>Add Paths</value>
</data>
<data name="PackagePathPreferencesTitle" xml:space="preserve">
<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>
</data>
Expand Down
6 changes: 6 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2405,6 +2405,12 @@ Uninstall the following packages: {0}?</value>
<data name="PreferencesPackageManagerSettingsTab" xml:space="preserve">
<value>Package Manager</value>
</data>
<data name="PackagePathAddPathButtonName" xml:space="preserve">
<value>Add Paths</value>
</data>
<data name="PackagePathPreferencesTitle" xml:space="preserve">
<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>
</data>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 45 additions & 2 deletions src/DynamoCoreWpf/UI/Themes/Modern/DynamoModern.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,8 @@
</Setter>
</Style>



<Style x:Key="SDarkTextBox"
BasedOn="{StaticResource {x:Type TextBox}}"
TargetType="{x:Type TextBox}">
Expand Down Expand Up @@ -2266,6 +2268,8 @@

<SolidColorBrush x:Key="PreferencesWindowBackgroundColor"
Color="#535353" />
<SolidColorBrush x:Key="PreferencesWindowItemDarkerBackgroundColor"
Color="#353535"/>
<SolidColorBrush x:Key="PreferencesWindowFontColor"
Color="#E5E5E5" />
<SolidColorBrush x:Key="PreferencesWindowButtonColor"
Expand Down Expand Up @@ -2299,6 +2303,25 @@
<!--White Window Color for borders-->
<Color x:Key="PreferencesToogleBorderColor" R="255" G="255" B="255" A="255"/>

<Style x:Key="DarkTextBlock"
TargetType="TextBlock">
<Setter Property="FontSize"
Value="12">
</Setter>
<Setter Property="TextTrimming"
Value="CharacterEllipsis">
</Setter>
</Style>

<Style x:Key="PreferenceTitleLabelStyle"
TargetType="{x:Type Label}">
<Setter Property="Foreground"
Value="{StaticResource PreferencesWindowFontColor}">
</Setter>
<Setter Property="FontSize"
Value="14">
</Setter>
</Style>

<Style x:Key="CaptionButtonStyleClose"
TargetType="Button">
Expand Down Expand Up @@ -2445,10 +2468,19 @@
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>


<DataTemplate x:Key="expanderHeader">
<TextBlock
Text="{Binding}"
FontSize="14"
FontWeight="Medium">
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will probably do something once we change all the fonts to Artifakt.

</TextBlock>
</DataTemplate>

<Style TargetType="Expander" x:Key="MenuExpanderStyle">
<Setter Property="Background" Value="{StaticResource SecondaryGray}"/>
<Setter Property="Foreground" Value="{StaticResource PreferencesWindowFontColor}"/>
<Setter Property="HeaderTemplate" Value="{StaticResource expanderHeader}"/>
<Setter Property="Template">
<Setter.Value>
<!-- Control template for expander -->
Expand Down Expand Up @@ -2482,10 +2514,14 @@
</Setter>
</Style>




<!-- This expander style is similar to the MenuExpanderStyle and the only difference is the left-margin spacing -->
<Style TargetType="Expander" x:Key="WorkspaceReferencesExpanderStyle">
<Setter Property="Background" Value="{StaticResource SecondaryGray}"/>
<Setter Property="Foreground" Value="{StaticResource PreferencesWindowFontColor}"/>
<Setter Property="HeaderTemplate" Value="{StaticResource expanderHeader}"/>
<Setter Property="Template">
<Setter.Value>
<!-- Control template for expander -->
Expand Down Expand Up @@ -3223,10 +3259,17 @@
</Trigger>
</Style.Triggers>
</Style>



<!--This Style will be used for the small trash icon button that appears when a new Style is created in the Visual Settings tab-->
<Style x:Key="RemoveStyleButtonStyle"
<Style x:Key="FlatIconButtonStyle"
TargetType="{x:Type Button}">
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value=".5" />
</Trigger>
</Style.Triggers>
<Setter Property="Background"
Value="Transparent"/>
<Setter Property="Template">
Expand Down
20 changes: 0 additions & 20 deletions src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,6 @@ internal PreferencesViewModel PreferencesViewModel
{
return preferencesViewModel;
}
set
{
preferencesViewModel = value;
RaisePropertyChanged(nameof(PreferencesViewModel));
}
}

public Point TransformOrigin
Expand Down Expand Up @@ -1695,21 +1690,6 @@ internal bool CanShowPackageManagerSearch(object parameters)
return true;
}

private void ShowInstalledPackages(object parameters)
{
OnRequestManagePackagesDialog(this, EventArgs.Empty);
}

private bool CanShowInstalledPackages(object parameters)
{
return true;
}

private void ManagePackagePaths(object parameters)
{
OnRequestPackagePathsDialog(this, EventArgs.Empty);
}

/// <summary>
/// Change the currently visible workspace to a custom node's workspace
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ private void InitializeDelegateCommands()
DisplayStartPageCommand = new DelegateCommand(DisplayStartPage, CanDisplayStartPage);
ShowPackageManagerSearchCommand = new DelegateCommand(ShowPackageManagerSearch, CanShowPackageManagerSearch);
PublishNewPackageCommand = new DelegateCommand(PackageManagerClientViewModel.PublishNewPackage, PackageManagerClientViewModel.CanPublishNewPackage);
ShowInstalledPackagesCommand = new DelegateCommand(ShowInstalledPackages, CanShowInstalledPackages);
ManagePackagePathsCommand = new DelegateCommand(ManagePackagePaths, o => true);
ShowInstalledPackagesCommand = new DelegateCommand(o => { }, o => true);
ManagePackagePathsCommand = new DelegateCommand(o => { }, o => true);
PublishCurrentWorkspaceCommand = new DelegateCommand(PackageManagerClientViewModel.PublishCurrentWorkspace, PackageManagerClientViewModel.CanPublishCurrentWorkspace);
PublishSelectedNodesCommand = new DelegateCommand(PackageManagerClientViewModel.PublishSelectedNodes, PackageManagerClientViewModel.CanPublishSelectedNodes);
PublishCustomNodeCommand = new DelegateCommand<Function>(PackageManagerClientViewModel.PublishCustomNode, PackageManagerClientViewModel.CanPublishCustomNode);
Expand Down Expand Up @@ -104,7 +104,9 @@ private void InitializeDelegateCommands()
public DelegateCommand GraphAutoLayoutCommand { get; set; }
public DelegateCommand GoHomeCommand { get; set; }
public DelegateCommand ShowPackageManagerSearchCommand { get; set; }
[Obsolete("Do not use. This command will be removed. It does nothing.")]
public DelegateCommand ShowInstalledPackagesCommand { get; set; }
[Obsolete("Do not use. This command will be removed. It does nothing.")]
public DelegateCommand ManagePackagePathsCommand { get; set; }
public DelegateCommand HomeCommand { get; set; }
public DelegateCommand ExitCommand { get; set; }
Expand Down
5 changes: 4 additions & 1 deletion src/DynamoCoreWpf/ViewModels/Core/DynamoViewModelEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ namespace Dynamo.ViewModels
{
partial class DynamoViewModel
{
[Obsolete("This event will be removed, do not use. It does nothing.")]
public event EventHandler RequestManagePackagesDialog;
[Obsolete("This method will be removed do not use. It does nothing.")]
public virtual void OnRequestManagePackagesDialog(Object sender, EventArgs e)
{
if (RequestManagePackagesDialog != null)
Expand All @@ -30,8 +32,9 @@ public virtual void OnRequestPackageManagerSearchDialog(Object sender, EventArgs
RequestPackageManagerSearchDialog(this, e);
}
}

[Obsolete("This event will be removed, do not use. It does nothing.")]
public event EventHandler RequestPackagePathsDialog;
[Obsolete("This method will be removed do not use. It does nothing.")]
public virtual void OnRequestPackagePathsDialog(object sender, EventArgs e)
{
var handler = RequestPackagePathsDialog;
Expand Down
18 changes: 18 additions & 0 deletions src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Dynamo.Graph.Workspaces;
using Dynamo.Logging;
using Dynamo.Models;
using Dynamo.PackageManager;
using Dynamo.Wpf.ViewModels.Core.Converters;
using Res = Dynamo.Wpf.Properties.Resources;

Expand Down Expand Up @@ -622,6 +623,11 @@ private void AddPythonEnginesOptions()
}
#endregion

/// <summary>
/// Package Search Paths view model.
/// </summary>
public PackagePathViewModel PackagePathsViewModel { get; set; }

/// <summary>
/// The PreferencesViewModel constructor basically initialize all the ItemsSource for the corresponding ComboBox in the View (PreferencesView.xaml)
/// </summary>
Expand Down Expand Up @@ -696,6 +702,18 @@ public PreferencesViewModel(DynamoViewModel dynamoViewModel)
preferencesTabs.Add("General", new TabSettings() { Name = "General", ExpanderActive = string.Empty });
preferencesTabs.Add("Features",new TabSettings() { Name = "Features", ExpanderActive = string.Empty });
preferencesTabs.Add("VisualSettings",new TabSettings() { Name = "VisualSettings", ExpanderActive = string.Empty });
preferencesTabs.Add("Package Manager", new TabSettings() { Name = "Package Manager", ExpanderActive = string.Empty });
mjkkirschner marked this conversation as resolved.
Show resolved Hide resolved

//create a packagePathsViewModel we'll use to interact with the package search paths list.
var loadPackagesParams = new LoadPackageParams
{
Preferences = preferenceSettings,
PathManager = dynamoViewModel.Model.PathManager,
};
var customNodeManager = dynamoViewModel.Model.CustomNodeManager;
var packageLoader = dynamoViewModel.Model.GetPackageManagerExtension()?.PackageLoader;
PackagePathsViewModel = new PackagePathViewModel(packageLoader, loadPackagesParams, customNodeManager);

this.PropertyChanged += Model_PropertyChanged;
}

Expand Down
Loading