forked from microsoft/PowerToys
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Initial draft of the winget extension #356
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
d8d0846
Add support for hiding messages too
zadjii-msft f0fc62c
vastly improved status messages
zadjii-msft 8a0576c
Gotta be able to support updating commands too
zadjii 2e22daa
Initial draft of the winget extension
zadjii e6dc668
Add icons to packages too
zadjii 0a5742a
You gotta start top-down, not bottom up
zadjii 8f885ca
THANK YOU XAML LLAMA
zadjii 0df00a2
better exception suppression
zadjii b404fb7
async async
zadjii 55fea59
remove dead code and spel
zadjii 983944a
Merge remote-tracking branch 'origin/main' into dev/migrie/f/winget
zadjii cdfed45
Merge branch 'dev/migrie/f/winget' into dev/migrie/f/details-metadata
zadjii 3d82ca1
Status messages that work per-builtin
zadjii 6a5161d
Merge branch 'dev/migrie/f/details-metadata' into dev/migrie/f/winget
zadjii d1256e1
xaml format
zadjii File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/DetailsDataViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright (c) Microsoft Corporation | ||
// The Microsoft Corporation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using Microsoft.CmdPal.Extensions; | ||
using Microsoft.CmdPal.UI.ViewModels.Models; | ||
|
||
namespace Microsoft.CmdPal.UI.ViewModels; | ||
|
||
public abstract partial class DetailsDataViewModel(IPageContext context) : ExtensionObjectViewModel(context) | ||
{ | ||
} |
27 changes: 27 additions & 0 deletions
27
src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/DetailsElementViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (c) Microsoft Corporation | ||
// The Microsoft Corporation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using Microsoft.CmdPal.Extensions; | ||
using Microsoft.CmdPal.UI.ViewModels.Models; | ||
|
||
namespace Microsoft.CmdPal.UI.ViewModels; | ||
|
||
public abstract partial class DetailsElementViewModel(IDetailsElement _detailsElement, IPageContext context) : ExtensionObjectViewModel(context) | ||
{ | ||
private readonly ExtensionObject<IDetailsElement> _model = new(_detailsElement); | ||
|
||
public string Key { get; private set; } = string.Empty; | ||
|
||
public override void InitializeProperties() | ||
{ | ||
var model = _model.Unsafe; | ||
if (model == null) | ||
{ | ||
return; | ||
} | ||
|
||
Key = model.Key ?? string.Empty; | ||
UpdateProperty(nameof(Key)); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/DetailsLinkViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (c) Microsoft Corporation | ||
// The Microsoft Corporation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using Microsoft.CmdPal.Extensions; | ||
using Microsoft.CmdPal.UI.ViewModels.Models; | ||
|
||
namespace Microsoft.CmdPal.UI.ViewModels; | ||
|
||
public partial class DetailsLinkViewModel( | ||
IDetailsElement _detailsElement, | ||
IPageContext context) : DetailsElementViewModel(_detailsElement, context) | ||
{ | ||
private readonly ExtensionObject<IDetailsLink> _dataModel = | ||
new(_detailsElement.Data as IDetailsLink); | ||
|
||
public string Text { get; private set; } = string.Empty; | ||
|
||
public Uri? Link { get; private set; } | ||
|
||
public bool IsLink => Link != null; | ||
|
||
public bool IsText => !IsLink; | ||
|
||
public override void InitializeProperties() | ||
{ | ||
base.InitializeProperties(); | ||
var model = _dataModel.Unsafe; | ||
if (model == null) | ||
{ | ||
return; | ||
} | ||
|
||
Text = model.Text ?? string.Empty; | ||
Link = model.Link; | ||
UpdateProperty(nameof(Text)); | ||
UpdateProperty(nameof(Link)); | ||
UpdateProperty(nameof(IsLink)); | ||
UpdateProperty(nameof(IsText)); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/DetailsSeparatorViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) Microsoft Corporation | ||
// The Microsoft Corporation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using Microsoft.CmdPal.Extensions; | ||
using Microsoft.CmdPal.UI.ViewModels.Models; | ||
|
||
namespace Microsoft.CmdPal.UI.ViewModels; | ||
|
||
public partial class DetailsSeparatorViewModel( | ||
IDetailsElement _detailsElement, | ||
IPageContext context) : DetailsElementViewModel(_detailsElement, context) | ||
{ | ||
private readonly ExtensionObject<IDetailsSeparator> _dataModel = | ||
new(_detailsElement.Data as IDetailsSeparator); | ||
|
||
public override void InitializeProperties() | ||
{ | ||
base.InitializeProperties(); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/DetailsTagsViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright (c) Microsoft Corporation | ||
// The Microsoft Corporation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using Microsoft.CmdPal.Extensions; | ||
using Microsoft.CmdPal.UI.ViewModels.Models; | ||
|
||
namespace Microsoft.CmdPal.UI.ViewModels; | ||
|
||
public partial class DetailsTagsViewModel( | ||
IDetailsElement _detailsElement, | ||
IPageContext context) : DetailsElementViewModel(_detailsElement, context) | ||
{ | ||
private readonly ExtensionObject<IDetailsTags> _dataModel = | ||
new(_detailsElement.Data as IDetailsTags); | ||
|
||
public override void InitializeProperties() | ||
{ | ||
base.InitializeProperties(); | ||
var model = _dataModel.Unsafe; | ||
if (model == null) | ||
{ | ||
return; | ||
} | ||
|
||
// TODO! | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / check-spelling
Ignored Expect Variant Warning