-
Notifications
You must be signed in to change notification settings - Fork 2
Dev drive insights and pip cache move rebased to changes from main #2486
Changes from 4 commits
6058ab8
1a0d87f
aa482b9
f162c12
a1a730a
54fd0cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -117,6 +117,34 @@ | |||||||
<resheader name="writer"> | ||||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | ||||||||
</resheader> | ||||||||
<data name="ChooseDirectoryPromptText" xml:space="preserve"> | ||||||||
<value>Choose directory on dev drive...</value> | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dev Drive should be capitalized, I believe. (Applies to all instances on this page)
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is what it says in the Figma. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. actually @SohamDas2021 it should be like Kristen outlined, If I recall, it was from Marketing who said that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So capitalize all Dev Drive in the text? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed, thanks. |
||||||||
<comment>Choose directory on dev drive</comment> | ||||||||
</data> | ||||||||
<data name="DevDriveFreeSizeText" xml:space="preserve"> | ||||||||
<value>{0} {1} free</value> | ||||||||
<comment>Dev drive size free</comment> | ||||||||
</data> | ||||||||
<data name="DevDriveInsightsCard.Description" xml:space="preserve"> | ||||||||
<value>All things, dev drives, optimizations, etc.</value> | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missed this one, but will let you update it in another PR #Resolved |
||||||||
<comment>The description for the Dev Drive Insights settings card</comment> | ||||||||
</data> | ||||||||
<data name="DevDriveInsightsCard.Header" xml:space="preserve"> | ||||||||
<value>Dev Drive Insights</value> | ||||||||
<comment>The header for the Dev Drive Insights settings card</comment> | ||||||||
</data> | ||||||||
<data name="DevDriveInsights_Header" xml:space="preserve"> | ||||||||
<value>Dev Drive Insights</value> | ||||||||
<comment>Header for Dev Drive insights page in the breadcrumb bar</comment> | ||||||||
</data> | ||||||||
<data name="DevDriveSizeText" xml:space="preserve"> | ||||||||
<value>Size - {0} {1}</value> | ||||||||
<comment>Dev drive size</comment> | ||||||||
</data> | ||||||||
<data name="DevDriveUsedSizeText" xml:space="preserve"> | ||||||||
<value>{0} {1} used</value> | ||||||||
<comment>Dev drive size used</comment> | ||||||||
</data> | ||||||||
<data name="DeveloperFileExplorerCard.Description" xml:space="preserve"> | ||||||||
<value>Adjust these settings for a more developer-friendly experience using File Explorer</value> | ||||||||
<comment>The description for the Developer File Explorer settings card</comment> | ||||||||
|
@@ -133,10 +161,22 @@ | |||||||
<value>Enable end task in taskbar by right click</value> | ||||||||
<comment>The description for the end task on task bar settings card</comment> | ||||||||
</data> | ||||||||
<data name="ExampleDevDriveLocation" xml:space="preserve"> | ||||||||
<value>Example: E:\packages\pip</value> | ||||||||
<comment>Example dev drive location</comment> | ||||||||
</data> | ||||||||
<data name="EndTaskOnTaskBar.Header" xml:space="preserve"> | ||||||||
<value>End Task</value> | ||||||||
<comment>The header for the end task on task bar settings card</comment> | ||||||||
</data> | ||||||||
<data name="MakeChangesText" xml:space="preserve"> | ||||||||
<value>Make changes</value> | ||||||||
<comment>Make changes button on dialog</comment> | ||||||||
</data> | ||||||||
<data name="MakeTheChangeText" xml:space="preserve"> | ||||||||
<value>Make the change</value> | ||||||||
<comment>Make the change button on optimizer card</comment> | ||||||||
</data> | ||||||||
<data name="MoreWindowsSettingsSectionDescription.Text" xml:space="preserve"> | ||||||||
<value>Additional settings below can be configured in the system settings app</value> | ||||||||
<comment>Description and context for a group of Windows settings in the system settings app</comment> | ||||||||
|
@@ -149,6 +189,18 @@ | |||||||
<value>Windows customization</value> | ||||||||
<comment>Navigation pane content</comment> | ||||||||
</data> | ||||||||
<data name="OptimizedDevDriveDescription" xml:space="preserve"> | ||||||||
<value>The environment variable {0} is set to {1}</value> | ||||||||
<comment>Optimized dev drive description</comment> | ||||||||
</data> | ||||||||
<data name="OptimizeDevDriveDialogDescription.Text" xml:space="preserve"> | ||||||||
<value>Contents of {0} will be copied to chosen directory. And {1} will be set to chosen directory.</value> | ||||||||
<comment>Optimize dev drive dialog description</comment> | ||||||||
</data> | ||||||||
<data name="OptimizerDevDriveDescription" xml:space="preserve"> | ||||||||
<value>Global environment variable {0} is set to {1}, which is not located on dev drive. Move contents of this folder to a directory on dev drive such as {2} and set {3} to that chosen directory on dev drive</value> | ||||||||
<comment>Optimizer dev drive description</comment> | ||||||||
</data> | ||||||||
<data name="SettingsAutoSuggestBox.PlaceholderText" xml:space="preserve"> | ||||||||
<value>Search</value> | ||||||||
<comment>The placholder text for the settings auto suggest box</comment> | ||||||||
|
@@ -173,6 +225,14 @@ | |||||||
<value>Show hidden and system files</value> | ||||||||
<comment>The header for the show hidden and system files setting.</comment> | ||||||||
</data> | ||||||||
<data name="DevDriveOptimizationSuggestion" xml:space="preserve"> | ||||||||
<value>Suggestion</value> | ||||||||
<comment>Dev drive optimization suggestion</comment> | ||||||||
</data> | ||||||||
<data name="DevDriveOptimized" xml:space="preserve"> | ||||||||
<value>Optimized</value> | ||||||||
<comment>Dev drive optimized indicator</comment> | ||||||||
</data> | ||||||||
<data name="MainPage_Header" xml:space="preserve"> | ||||||||
<value>Windows customization</value> | ||||||||
<comment>Header for main Windows customization page in the breadcrumb bar</comment> | ||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
using CommunityToolkit.Mvvm.ComponentModel; | ||
using DevHome.Common.Models; | ||
using DevHome.Common.Services; | ||
using DevHome.SetupFlow.Utilities; | ||
|
||
using Dispatching = Microsoft.UI.Dispatching; | ||
|
||
namespace DevHome.Customization.ViewModels.DevDriveInsights; | ||
|
||
/// <summary> | ||
/// View model for the card that represents a dev drive on the dev drive insights page. | ||
/// </summary> | ||
public partial class DevDriveCardViewModel : ObservableObject | ||
{ | ||
private readonly Dispatching.DispatcherQueue _dispatcher; | ||
|
||
private readonly DevHome.Common.Services.IDevDriveManager _devDriveManager; | ||
|
||
public string DevDriveLabel { get; set; } | ||
|
||
public ulong DevDriveSize { get; set; } | ||
|
||
public ulong DevDriveFreeSize { get; set; } | ||
|
||
public ulong DevDriveUsedSize { get; set; } | ||
|
||
public double DevDriveFillPercentage { get; set; } | ||
|
||
public string DevDriveUnitOfMeasure { get; set; } | ||
|
||
public string DevDriveSizeText { get; set; } | ||
|
||
public string DevDriveUsedSizeText { get; set; } | ||
|
||
public string DevDriveFreeSizeText { get; set; } | ||
|
||
public DevDriveCardViewModel(IDevDrive devDrive, IDevDriveManager manager) | ||
{ | ||
_dispatcher = Dispatching.DispatcherQueue.GetForCurrentThread(); | ||
_devDriveManager = manager; | ||
|
||
DevDriveLabel = devDrive.DriveLabel; | ||
var divider = (ulong)((devDrive.DriveUnitOfMeasure == ByteUnit.TB) ? 1000_000_000_000 : 1000_000_000); | ||
DevDriveSize = devDrive.DriveSizeInBytes / divider; | ||
DevDriveFreeSize = devDrive.DriveSizeRemainingInBytes / divider; | ||
DevDriveUsedSize = DevDriveSize - DevDriveFreeSize; | ||
DevDriveUnitOfMeasure = (devDrive.DriveUnitOfMeasure == ByteUnit.TB) ? "TB" : "GB"; | ||
DevDriveFillPercentage = ((DevDriveSize - DevDriveFreeSize) * 100) / DevDriveSize; | ||
var stringResource = new StringResource("DevHome.Customization.pri", "DevHome.Customization/Resources"); | ||
DevDriveSizeText = stringResource.GetLocalized("DevDriveSizeText", DevDriveSize, DevDriveUnitOfMeasure); | ||
DevDriveUsedSizeText = stringResource.GetLocalized("DevDriveUsedSizeText", DevDriveUsedSize, DevDriveUnitOfMeasure); | ||
DevDriveFreeSizeText = stringResource.GetLocalized("DevDriveFreeSizeText", DevDriveFreeSize, DevDriveUnitOfMeasure); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
using CommunityToolkit.Mvvm.ComponentModel; | ||
using DevHome.Common.Services; | ||
|
||
namespace DevHome.Customization.ViewModels.DevDriveInsights; | ||
|
||
/// <summary> | ||
/// View model for the card that represents an optimized cache on the dev drive insights page. | ||
/// </summary> | ||
public partial class DevDriveOptimizedCardViewModel : ObservableObject | ||
{ | ||
public string CacheMoved { get; set; } | ||
|
||
public string OptimizedCacheLocation { get; set; } | ||
|
||
public string EnvironmentVariableSet { get; set; } | ||
|
||
public string OptimizedDevDriveDescription { get; set; } | ||
|
||
public string DevDriveOptimized { get; set; } | ||
|
||
public DevDriveOptimizedCardViewModel(string cacheMoved, string optimizedCacheLocation, string environmentVariableSet) | ||
{ | ||
CacheMoved = cacheMoved; | ||
OptimizedCacheLocation = optimizedCacheLocation; | ||
EnvironmentVariableSet = environmentVariableSet; | ||
var stringResource = new StringResource("DevHome.Customization.pri", "DevHome.Customization/Resources"); | ||
OptimizedDevDriveDescription = stringResource.GetLocalized("OptimizedDevDriveDescription", EnvironmentVariableSet, OptimizedCacheLocation); | ||
DevDriveOptimized = stringResource.GetLocalized("DevDriveOptimized"); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using System.Threading.Tasks; | ||
using CommunityToolkit.Mvvm.ComponentModel; | ||
using CommunityToolkit.Mvvm.Input; | ||
using DevHome.Common.Services; | ||
using DevHome.Customization.Views; | ||
using Microsoft.UI.Xaml.Controls; | ||
|
||
namespace DevHome.Customization.ViewModels.DevDriveInsights; | ||
|
||
/// <summary> | ||
/// View model for the card that represents a dev drive optimizer on the dev drive insights page. | ||
/// </summary> | ||
public partial class DevDriveOptimizerCardViewModel : ObservableObject | ||
{ | ||
public OptimizeDevDriveDialogViewModelFactory OptimizeDevDriveDialogViewModelFactory { get; set; } | ||
|
||
public string CacheToBeMoved { get; set; } | ||
|
||
public string DevDriveOptimizationSuggestion { get; set; } | ||
|
||
public string ExistingCacheLocation { get; set; } | ||
|
||
public string ExampleLocationOnDevDrive { get; set; } | ||
|
||
public string EnvironmentVariableToBeSet { get; set; } | ||
|
||
public string OptimizerDevDriveDescription { get; set; } | ||
|
||
public string MakeTheChangeText { get; set; } | ||
|
||
/// <summary> | ||
/// User wants to optimize a dev drive. | ||
/// </summary> | ||
[RelayCommand] | ||
private async Task OptimizeDevDriveAsync(object sender) | ||
{ | ||
var settingsCard = sender as Button; | ||
if (settingsCard != null) | ||
{ | ||
var optimizeDevDriveViewModel = OptimizeDevDriveDialogViewModelFactory(ExistingCacheLocation, EnvironmentVariableToBeSet); | ||
var optimizeDevDriveDialog = new OptimizeDevDriveDialog(optimizeDevDriveViewModel); | ||
optimizeDevDriveDialog.XamlRoot = settingsCard.XamlRoot; | ||
optimizeDevDriveDialog.RequestedTheme = settingsCard.ActualTheme; | ||
await optimizeDevDriveDialog.ShowAsync(); | ||
} | ||
} | ||
|
||
public DevDriveOptimizerCardViewModel(OptimizeDevDriveDialogViewModelFactory optimizeDevDriveDialogViewModelFactory, string cacheToBeMoved, string existingCacheLocation, string exampleLocationOnDevDrive, string environmentVariableToBeSet) | ||
{ | ||
OptimizeDevDriveDialogViewModelFactory = optimizeDevDriveDialogViewModelFactory; | ||
CacheToBeMoved = cacheToBeMoved; | ||
ExistingCacheLocation = existingCacheLocation; | ||
ExampleLocationOnDevDrive = exampleLocationOnDevDrive; | ||
EnvironmentVariableToBeSet = environmentVariableToBeSet; | ||
var stringResource = new StringResource("DevHome.Customization.pri", "DevHome.Customization/Resources"); | ||
OptimizerDevDriveDescription = stringResource.GetLocalized("OptimizerDevDriveDescription", EnvironmentVariableToBeSet, ExistingCacheLocation, ExampleLocationOnDevDrive, EnvironmentVariableToBeSet); | ||
MakeTheChangeText = stringResource.GetLocalized("MakeTheChangeText"); | ||
DevDriveOptimizationSuggestion = stringResource.GetLocalized("DevDriveOptimizationSuggestion"); | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be great if you could add the DevHome.Customization project to the mermaid diagram of project relationships in https://github.com/microsoft/devhome/blob/main/docs/architecture.md #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#2506