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

single New Package Download Path #14559

Merged
merged 3 commits into from
Nov 4, 2023
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Dynamo.Controls;
using System;
using System.Collections.ObjectModel;
using Dynamo.ViewModels;
using NotificationObject = Dynamo.Core.NotificationObject;
using System.Collections.ObjectModel;

namespace Dynamo.PackageManager
{
Expand Down Expand Up @@ -53,6 +53,12 @@ public PackageManagerViewModel(DynamoViewModel dynamoViewModel, PackageManagerSe
PkgSearchVM.RegisterTransientHandlers();

LocalPackages.CollectionChanged += LocalPackages_CollectionChanged;

// We are forced to make the update ourselves if the Preferences ViewModel has not been initialized yet
if (String.IsNullOrEmpty(PreferencesViewModel?.SelectedPackagePathForInstall))
{
PreferencesViewModel.SelectedPackagePathForInstall = dynamoViewModel.PreferenceSettings.SelectedPackagePathForInstall;
}
}

private void LocalPackages_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
Expand Down
27 changes: 19 additions & 8 deletions src/DynamoCoreWpf/Views/PackageManager/PackageManagerView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@
<controls:EmptyListToVisibilityConverter x:Key="EmptyListToVisibilityConverter" />
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />

<Style x:Key="PkgMngTextBlockStyle" TargetType="TextBlock">
<Setter Property="Width" Value="Auto" />
<Setter Property="Margin" Value="0 5" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Background" Value="#2F2E30" />
<Setter Property="Foreground" Value="#EEEEEE" />
<Setter Property="FontFamily" Value="{StaticResource ArtifaktElementRegular}" />
<Setter Property="FontStyle" Value="Normal" />
<Setter Property="FontSize" Value="12px " />
<Setter Property="Focusable" Value="False" />
<Setter Property="Padding" Value="5 10"/>
</Style>
<Style x:Key="PkgMngListBoxStyle" TargetType="ListBox">
<Setter Property="Width" Value="Auto" />
<Setter Property="Margin" Value="0 5" />
Expand Down Expand Up @@ -486,17 +498,16 @@
Style="{StaticResource GenericToolTipLight}" />
</Label.ToolTip>
</Label>
<ListBox Grid.Row="1"
<!-- Default download path -->
<TextBlock Grid.Row="1"
x:Name="PackageDownloadDirectoryListBox"
Style="{DynamicResource PkgMngListBoxStyle}"
ItemContainerStyle="{DynamicResource PkgMngListBoxItemStyle}"
ItemsSource="{Binding Path=PackagePathsForInstall}"
SelectedItem="{Binding Path=SelectedPackagePathForInstall}">
<ListBox.ToolTip>
Style="{StaticResource PkgMngTextBlockStyle}"
Text="{Binding Path=SelectedPackagePathForInstall, UpdateSourceTrigger=PropertyChanged}">
<TextBlock.ToolTip>
<ToolTip Content="{Binding Path=SelectedPackagePathForInstall}"
Style="{StaticResource GenericToolTipLight}" />
</ListBox.ToolTip>
</ListBox>
</TextBlock.ToolTip>
</TextBlock>

<Label Content="{x:Static p:Resources.PackagePathPreferencesTitle}"
Padding="5,5,5,5"
Expand Down
Loading