mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-01-25 21:47:14 +01:00
Compare commits
32 Commits
v0.87.1
...
cinnamon-m
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b0dfabda5 | ||
|
|
83102012da | ||
|
|
db011af1e8 | ||
|
|
5ef918750d | ||
|
|
084978c465 | ||
|
|
0d71f11fdc | ||
|
|
a29ff07ec0 | ||
|
|
cd2a88704d | ||
|
|
308c4b817e | ||
|
|
809791da25 | ||
|
|
5e9675eb4f | ||
|
|
6ca02f0d3c | ||
|
|
90e75a19f0 | ||
|
|
deddce22e7 | ||
|
|
21391bbc5b | ||
|
|
bd30da6001 | ||
|
|
94d712135c | ||
|
|
1eec678276 | ||
|
|
2ba5fb75bc | ||
|
|
a720dd537c | ||
|
|
e4d2deb89e | ||
|
|
fbd72cc1ea | ||
|
|
bb637c16dc | ||
|
|
ea23f1ec1a | ||
|
|
f727762d03 | ||
|
|
e2cd8633b9 | ||
|
|
2a6dcb9f70 | ||
|
|
342c6167f5 | ||
|
|
20a5f67222 | ||
|
|
86c6b4ae95 | ||
|
|
ea66066a54 | ||
|
|
43bc811c59 |
@@ -12,7 +12,6 @@ properties:
|
||||
id: vsPackage
|
||||
directives:
|
||||
description: Install Visual Studio 2022 Community (Any edition will work)
|
||||
allowPrerelease: true
|
||||
settings:
|
||||
id: Microsoft.VisualStudio.2022.Community
|
||||
source: winget
|
||||
|
||||
@@ -12,7 +12,6 @@ properties:
|
||||
id: vsPackage
|
||||
directives:
|
||||
description: Install Visual Studio 2022 Enterprise (Any edition will work)
|
||||
allowPrerelease: true
|
||||
settings:
|
||||
id: Microsoft.VisualStudio.2022.Enterprise
|
||||
source: winget
|
||||
|
||||
@@ -12,7 +12,6 @@ properties:
|
||||
id: vsPackage
|
||||
directives:
|
||||
description: Install Visual Studio 2022 Professional (Any edition will work)
|
||||
allowPrerelease: true
|
||||
settings:
|
||||
id: Microsoft.VisualStudio.2022.Professional
|
||||
source: winget
|
||||
|
||||
18
.github/actions/spell-check/allow/code.txt
vendored
18
.github/actions/spell-check/allow/code.txt
vendored
@@ -78,7 +78,14 @@ sinclairinat
|
||||
stylecop
|
||||
uipi
|
||||
yinwang
|
||||
|
||||
myaccess
|
||||
onmicrosoft
|
||||
aep
|
||||
epsf
|
||||
howto
|
||||
onefuzzconfig
|
||||
oip
|
||||
onefuzzingestionpreparationtool
|
||||
|
||||
# KEYS
|
||||
|
||||
@@ -246,3 +253,12 @@ pwa
|
||||
|
||||
AOT
|
||||
Aot
|
||||
|
||||
# YML
|
||||
onefuzz
|
||||
|
||||
# NameInCode
|
||||
leilzh
|
||||
|
||||
#Tools
|
||||
OIP
|
||||
|
||||
17
.github/actions/spell-check/allow/names.txt
vendored
17
.github/actions/spell-check/allow/names.txt
vendored
@@ -46,6 +46,8 @@ betsegaw
|
||||
bricelam
|
||||
bsky
|
||||
CCcat
|
||||
chenmy
|
||||
chemwolf
|
||||
Chinh
|
||||
chrdavis
|
||||
Chrzan
|
||||
@@ -63,6 +65,7 @@ Deondre
|
||||
DHowett
|
||||
ductdo
|
||||
Essey
|
||||
Feng
|
||||
ethanfangg
|
||||
ferraridavide
|
||||
frankychen
|
||||
@@ -78,6 +81,7 @@ gordon
|
||||
grzhan
|
||||
Guo
|
||||
hanselman
|
||||
haoliuu
|
||||
Harmath
|
||||
Heiko
|
||||
Hemmerlein
|
||||
@@ -92,6 +96,7 @@ Jaswal
|
||||
jefflord
|
||||
Jordi
|
||||
jyuwono
|
||||
kai
|
||||
Kairu
|
||||
Kamra
|
||||
Kantarci
|
||||
@@ -109,6 +114,7 @@ Markovic
|
||||
martinchrzan
|
||||
martinmoene
|
||||
Melman
|
||||
Mengyuan
|
||||
Mikhayelyan
|
||||
msft
|
||||
Mykhailo
|
||||
@@ -121,11 +127,13 @@ oldnewthing
|
||||
onegreatworld
|
||||
palenshus
|
||||
pedrolamas
|
||||
Peiyao
|
||||
peteblois
|
||||
phoboslab
|
||||
Ponten
|
||||
Pooja
|
||||
Pylyp
|
||||
Qingpeng
|
||||
quachpas
|
||||
Quriz
|
||||
randyrants
|
||||
@@ -154,14 +162,23 @@ Taras
|
||||
TBM
|
||||
tilovell
|
||||
Triet
|
||||
urnotdfs
|
||||
waaverecords
|
||||
wang
|
||||
Whuihuan
|
||||
Xiaofeng
|
||||
Xpg
|
||||
Yaqing
|
||||
yaqingmi
|
||||
ycv
|
||||
yeelam
|
||||
Yuniardi
|
||||
yuyoyuppe
|
||||
Zeol
|
||||
Zhao
|
||||
Zhaopeng
|
||||
zhaopy
|
||||
zhaoqpcn
|
||||
Zoltan
|
||||
Zykova
|
||||
|
||||
|
||||
8
.github/actions/spell-check/expect.txt
vendored
8
.github/actions/spell-check/expect.txt
vendored
@@ -645,6 +645,7 @@ imageresizerinput
|
||||
imageresizersettings
|
||||
imagingdevices
|
||||
ime
|
||||
Indo
|
||||
inetcpl
|
||||
Infobar
|
||||
INFOEXAMPLE
|
||||
@@ -740,6 +741,7 @@ LExit
|
||||
lhwnd
|
||||
LIBID
|
||||
lindex
|
||||
linkid
|
||||
LINKOVERLAY
|
||||
LINQTo
|
||||
listview
|
||||
@@ -753,7 +755,7 @@ lnks
|
||||
LOADFROMFILE
|
||||
LOBYTE
|
||||
LOCALDISPLAY
|
||||
LOCALPACKAGE
|
||||
localpackage
|
||||
LOCALSYSTEM
|
||||
LOCATIONCHANGE
|
||||
LOGFONT
|
||||
@@ -1212,6 +1214,7 @@ QUEUESYNC
|
||||
QUNS
|
||||
RAII
|
||||
RAlt
|
||||
randi
|
||||
Rasterize
|
||||
RAWINPUTDEVICE
|
||||
RAWINPUTHEADER
|
||||
@@ -1721,6 +1724,7 @@ WIC
|
||||
wifi
|
||||
wil
|
||||
winapi
|
||||
winappsdk
|
||||
wincodec
|
||||
Wincodecsdk
|
||||
wincolor
|
||||
@@ -1845,5 +1849,3 @@ zonable
|
||||
zoneset
|
||||
Zoneszonabletester
|
||||
zzz
|
||||
|
||||
|
||||
|
||||
2
.github/actions/spell-check/patterns.txt
vendored
2
.github/actions/spell-check/patterns.txt
vendored
@@ -131,7 +131,7 @@ _mm_(?!dd)\w+
|
||||
|
||||
# hit-count: 4 file-count: 4
|
||||
# microsoft
|
||||
\b(?:https?://|)(?:(?:(?:blogs|download\.visualstudio|developer|docs|msdn2?|research)\.|)microsoft|blogs\.msdn)\.co(?:m|\.\w\w)/[-_a-zA-Z0-9()=./%]*
|
||||
\b(?:https?://|)(?:(?:(?:blogs|download\.visualstudio|developer|docs|learn|msdn2?|research)\.|)microsoft|blogs\.msdn)\.co(?:m|\.\w\w)/[-_a-zA-Z0-9()=./%#]*
|
||||
|
||||
aka\.ms/[a-zA-Z0-9]+
|
||||
|
||||
|
||||
130
.pipelines/UpdateVersions.ps1
Normal file
130
.pipelines/UpdateVersions.ps1
Normal file
@@ -0,0 +1,130 @@
|
||||
Param(
|
||||
# Using the default value of 1.6 for winAppSdkVersionNumber and useExperimentalVersion as false
|
||||
[Parameter(Mandatory=$False,Position=1)]
|
||||
[string]$winAppSdkVersionNumber = "1.6",
|
||||
|
||||
# When the pipeline calls the PS1 file, the passed parameters are converted to string type
|
||||
[Parameter(Mandatory=$False,Position=2)]
|
||||
[boolean]$useExperimentalVersion = $False
|
||||
)
|
||||
|
||||
function Update-NugetConfig {
|
||||
param (
|
||||
[string]$filePath = "nuget.config"
|
||||
)
|
||||
|
||||
Write-Host "Updating nuget.config file"
|
||||
[xml]$xml = Get-Content -Path $filePath
|
||||
|
||||
# Add localpackages source into nuget.config
|
||||
$packageSourcesNode = $xml.configuration.packageSources
|
||||
$addNode = $xml.CreateElement("add")
|
||||
$addNode.SetAttribute("key", "localpackages")
|
||||
$addNode.SetAttribute("value", "localpackages")
|
||||
$packageSourcesNode.AppendChild($addNode) | Out-Null
|
||||
|
||||
# Remove <packageSourceMapping> tag and its content
|
||||
$packageSourceMappingNode = $xml.configuration.packageSourceMapping
|
||||
if ($packageSourceMappingNode) {
|
||||
$xml.configuration.RemoveChild($packageSourceMappingNode) | Out-Null
|
||||
}
|
||||
|
||||
# print nuget.config after modification
|
||||
$xml.OuterXml
|
||||
# Save the modified nuget.config file
|
||||
$xml.Save($filePath)
|
||||
}
|
||||
|
||||
$sourceLink = "https://microsoft.pkgs.visualstudio.com/ProjectReunion/_packaging/Project.Reunion.nuget.internal/nuget/v3/index.json"
|
||||
|
||||
# Execute nuget list and capture the output
|
||||
if ($useExperimentalVersion) {
|
||||
# The nuget list for experimental versions will cost more time
|
||||
# So, we will not use -AllVersions to wast time
|
||||
# But it can only get the latest experimental version
|
||||
Write-Host "Fetching WindowsAppSDK with experimental versions"
|
||||
$nugetOutput = nuget list Microsoft.WindowsAppSDK `
|
||||
-Source $sourceLink `
|
||||
-Prerelease
|
||||
# Filter versions based on the specified version prefix
|
||||
$escapedVersionNumber = [regex]::Escape($winAppSdkVersionNumber)
|
||||
$filteredVersions = $nugetOutput | Where-Object { $_ -match "Microsoft.WindowsAppSDK $escapedVersionNumber\." }
|
||||
$latestVersions = $filteredVersions
|
||||
} else {
|
||||
Write-Host "Fetching stable WindowsAppSDK versions for $winAppSdkVersionNumber"
|
||||
$nugetOutput = nuget list Microsoft.WindowsAppSDK `
|
||||
-Source $sourceLink `
|
||||
-AllVersions
|
||||
# Filter versions based on the specified version prefix
|
||||
$escapedVersionNumber = [regex]::Escape($winAppSdkVersionNumber)
|
||||
$filteredVersions = $nugetOutput | Where-Object { $_ -match "Microsoft.WindowsAppSDK $escapedVersionNumber\." }
|
||||
$latestVersions = $filteredVersions | Sort-Object { [version]($_ -split ' ')[1] } -Descending | Select-Object -First 1
|
||||
}
|
||||
|
||||
Write-Host "Latest versions found: $latestVersions"
|
||||
# Extract the latest version number from the output
|
||||
$latestVersion = $latestVersions -split "`n" | `
|
||||
Select-String -Pattern 'Microsoft.WindowsAppSDK\s*([0-9]+\.[0-9]+\.[0-9]+-*[a-zA-Z0-9]*)' | `
|
||||
ForEach-Object { $_.Matches[0].Groups[1].Value } | `
|
||||
Sort-Object -Descending | `
|
||||
Select-Object -First 1
|
||||
|
||||
if ($latestVersion) {
|
||||
$WinAppSDKVersion = $latestVersion
|
||||
Write-Host "Extracted version: $WinAppSDKVersion"
|
||||
Write-Host "##vso[task.setvariable variable=WinAppSDKVersion]$WinAppSDKVersion"
|
||||
} else {
|
||||
Write-Host "Failed to extract version number from nuget list output"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Update packages.config files
|
||||
Get-ChildItem -Recurse packages.config | ForEach-Object {
|
||||
$content = Get-Content $_.FullName -Raw
|
||||
if ($content -match 'package id="Microsoft.WindowsAppSDK"') {
|
||||
$newVersionString = 'package id="Microsoft.WindowsAppSDK" version="' + $WinAppSDKVersion + '"'
|
||||
$oldVersionString = 'package id="Microsoft.WindowsAppSDK" version="[-.0-9a-zA-Z]*"'
|
||||
$content = $content -replace $oldVersionString, $newVersionString
|
||||
Set-Content -Path $_.FullName -Value $content
|
||||
Write-Host "Modified " $_.FullName
|
||||
}
|
||||
}
|
||||
|
||||
# Update Directory.Packages.props file
|
||||
$propsFile = "Directory.Packages.props"
|
||||
if (Test-Path $propsFile) {
|
||||
$content = Get-Content $propsFile -Raw
|
||||
if ($content -match '<PackageVersion Include="Microsoft.WindowsAppSDK"') {
|
||||
$newVersionString = '<PackageVersion Include="Microsoft.WindowsAppSDK" Version="' + $WinAppSDKVersion + '" />'
|
||||
$oldVersionString = '<PackageVersion Include="Microsoft.WindowsAppSDK" Version="[-.0-9a-zA-Z]*" />'
|
||||
$content = $content -replace $oldVersionString, $newVersionString
|
||||
Set-Content -Path $propsFile -Value $content
|
||||
Write-Host "Modified " $propsFile
|
||||
}
|
||||
}
|
||||
|
||||
# Update .vcxproj files
|
||||
Get-ChildItem -Recurse *.vcxproj | ForEach-Object {
|
||||
$content = Get-Content $_.FullName -Raw
|
||||
if ($content -match '\\Microsoft.WindowsAppSDK.') {
|
||||
$newVersionString = '\Microsoft.WindowsAppSDK.' + $WinAppSDKVersion + '\'
|
||||
$oldVersionString = '\\Microsoft.WindowsAppSDK.[-.0-9a-zA-Z]*\\'
|
||||
$content = $content -replace $oldVersionString, $newVersionString
|
||||
Set-Content -Path $_.FullName -Value $content
|
||||
Write-Host "Modified " $_.FullName
|
||||
}
|
||||
}
|
||||
|
||||
# Update .csproj files
|
||||
Get-ChildItem -Recurse *.csproj | ForEach-Object {
|
||||
$content = Get-Content $_.FullName -Raw
|
||||
if ($content -match 'PackageReference Include="Microsoft.WindowsAppSDK"') {
|
||||
$newVersionString = 'PackageReference Include="Microsoft.WindowsAppSDK" Version="'+ $WinAppSDKVersion + '"'
|
||||
$oldVersionString = 'PackageReference Include="Microsoft.WindowsAppSDK" Version="[-.0-9a-zA-Z]*"'
|
||||
$content = $content -replace $oldVersionString, $newVersionString
|
||||
Set-Content -Path $_.FullName -Value $content
|
||||
Write-Host "Modified " $_.FullName
|
||||
}
|
||||
}
|
||||
|
||||
Update-NugetConfig
|
||||
@@ -32,9 +32,9 @@ steps:
|
||||
TDBuildServiceConnection: $(TouchdownServiceConnection)
|
||||
authType: SubjectNameIssuer
|
||||
resourceFilePath: |
|
||||
**\Resources.resx
|
||||
**\Resource.resx
|
||||
**\Resources.resw
|
||||
src\**\Resources.resx
|
||||
src\**\Resource.resx
|
||||
src\**\Resources.resw
|
||||
outputDirectoryRoot: LocOutput
|
||||
appendRelativeDir: true
|
||||
pseudoSetting: Included
|
||||
|
||||
42
.pipelines/v2/ci-test-with-canary-webview2.yml
Normal file
42
.pipelines/v2/ci-test-with-canary-webview2.yml
Normal file
@@ -0,0 +1,42 @@
|
||||
trigger: none
|
||||
pr: none
|
||||
schedules:
|
||||
- cron: "0 0 * * *" # every day at midnight
|
||||
displayName: "Daily midnight Build"
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
always: false # only run if there's code changes!
|
||||
|
||||
name: $(BuildDefinitionName)_$(date:yyMM).$(date:dd)$(rev:rrr)
|
||||
|
||||
parameters:
|
||||
- name: buildPlatforms
|
||||
type: object
|
||||
default:
|
||||
- x64
|
||||
- arm64
|
||||
- name: enableMsBuildCaching
|
||||
type: boolean
|
||||
displayName: "Enable MSBuild Caching"
|
||||
default: false
|
||||
- name: runTests
|
||||
type: boolean
|
||||
displayName: "Run Tests"
|
||||
default: true
|
||||
- name: useVSPreview
|
||||
type: boolean
|
||||
displayName: "Build Using Visual Studio Preview"
|
||||
default: false
|
||||
- name: useLatestWebView2
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
extends:
|
||||
template: templates/pipeline-ci-build.yml
|
||||
parameters:
|
||||
buildPlatforms: ${{ parameters.buildPlatforms }}
|
||||
enableMsBuildCaching: ${{ parameters.enableMsBuildCaching }}
|
||||
runTests: ${{ parameters.runTests }}
|
||||
useVSPreview: ${{ parameters.useVSPreview }}
|
||||
useLatestWebView2: ${{ parameters.useLatestWebView2 }}
|
||||
50
.pipelines/v2/ci-using-the-latest-winappsdk.yml
Normal file
50
.pipelines/v2/ci-using-the-latest-winappsdk.yml
Normal file
@@ -0,0 +1,50 @@
|
||||
trigger: none
|
||||
pr: none
|
||||
schedules:
|
||||
- cron: "0 0 * * *" # every day at midnight
|
||||
displayName: "Daily midnight Build"
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
always: false # only run if there's code changes!
|
||||
|
||||
name: $(BuildDefinitionName)_$(date:yyMM).$(date:dd)$(rev:rrr)
|
||||
|
||||
parameters:
|
||||
- name: buildPlatforms
|
||||
type: object
|
||||
default:
|
||||
- x64
|
||||
- arm64
|
||||
- name: enableMsBuildCaching
|
||||
type: boolean
|
||||
displayName: "Enable MSBuild Caching"
|
||||
default: false
|
||||
- name: runTests
|
||||
type: boolean
|
||||
displayName: "Run Tests"
|
||||
default: true
|
||||
- name: useVSPreview
|
||||
type: boolean
|
||||
displayName: "Build Using Visual Studio Preview"
|
||||
default: false
|
||||
- name: useLatestWinAppSDK
|
||||
type: boolean
|
||||
default: true
|
||||
- name: winAppSDKVersionNumber
|
||||
type: string
|
||||
default: 1.6
|
||||
- name: useExperimentalVersion
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
extends:
|
||||
template: templates/pipeline-ci-build.yml
|
||||
parameters:
|
||||
buildPlatforms: ${{ parameters.buildPlatforms }}
|
||||
enableMsBuildCaching: ${{ parameters.enableMsBuildCaching }}
|
||||
runTests: ${{ parameters.runTests }}
|
||||
useVSPreview: ${{ parameters.useVSPreview }}
|
||||
useLatestWinAppSDK: ${{ parameters.useLatestWinAppSDK }}
|
||||
winAppSDKVersionNumber: ${{ parameters.winAppSDKVersionNumber }}
|
||||
useExperimentalVersion: ${{ parameters.useExperimentalVersion }}
|
||||
55
.pipelines/v2/oneFuzz.yml
Normal file
55
.pipelines/v2/oneFuzz.yml
Normal file
@@ -0,0 +1,55 @@
|
||||
pr: none
|
||||
trigger: none
|
||||
|
||||
schedules:
|
||||
- cron: "0 0 * * 1"
|
||||
displayName: Weekly fuzzing submission
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
always: true
|
||||
name: $(BuildDefinitionName)_$(date:yyMM).$(date:dd)$(rev:rrr)
|
||||
|
||||
parameters:
|
||||
- name: platform
|
||||
type: string
|
||||
default: x64 # for fuzzing, we only use x64 for now
|
||||
- name: enableMsBuildCaching
|
||||
type: boolean
|
||||
displayName: "Enable MSBuild Caching"
|
||||
default: false
|
||||
- name: useVSPreview
|
||||
type: boolean
|
||||
displayName: "Build Using Visual Studio Preview"
|
||||
default: false
|
||||
|
||||
stages:
|
||||
- stage: Build_${{ parameters.platform }}
|
||||
displayName: Build ${{ parameters.platform }}
|
||||
jobs:
|
||||
- template: templates/job-build-project.yml
|
||||
parameters:
|
||||
pool:
|
||||
${{ if eq(variables['System.CollectionId'], 'cb55739e-4afe-46a3-970f-1b49d8ee7564') }}:
|
||||
name: SHINE-INT-L
|
||||
${{ else }}:
|
||||
name: SHINE-OSS-L
|
||||
${{ if eq(parameters.useVSPreview, true) }}:
|
||||
demands: ImageOverride -equals SHINE-VS17-Preview
|
||||
buildPlatforms:
|
||||
- ${{ parameters.platform }}
|
||||
buildConfigurations: [Release]
|
||||
enablePackageCaching: true
|
||||
enableMsBuildCaching: ${{ parameters.enableMsBuildCaching }}
|
||||
runTests: true
|
||||
useVSPreview: ${{ parameters.useVSPreview }}
|
||||
|
||||
- stage: OneFuzz
|
||||
displayName: Fuzz ${{ parameters.platform }}
|
||||
dependsOn:
|
||||
- Build_${{parameters.platform}}
|
||||
jobs:
|
||||
- template: templates/job-fuzz.yml
|
||||
parameters:
|
||||
platform: ${{ parameters.platform }}
|
||||
configuration: Release
|
||||
@@ -56,6 +56,15 @@ parameters:
|
||||
- name: versionNumber
|
||||
type: string
|
||||
default: '0.0.1'
|
||||
- name: useLatestWinAppSDK
|
||||
type: boolean
|
||||
default: false
|
||||
- name: winAppSDKVersionNumber
|
||||
type: string
|
||||
default: 1.6
|
||||
- name: useExperimentalVersion
|
||||
type: boolean
|
||||
default: false
|
||||
- name: csProjectsToPublish
|
||||
type: object
|
||||
default:
|
||||
@@ -102,6 +111,10 @@ jobs:
|
||||
${{ else }}:
|
||||
MSBuildMainBuildTargets: Build
|
||||
${{ insert }}: ${{ parameters.variables }}
|
||||
${{ if eq(parameters.useLatestWinAppSDK, true) }}:
|
||||
RestoreAdditionalProjectSourcesArg: '/p:RestoreAdditionalProjectSources="$(Build.SourcesDirectory)\localpackages\NugetPackages"'
|
||||
${{ else }}:
|
||||
RestoreAdditionalProjectSourcesArg: ''
|
||||
displayName: Build
|
||||
timeoutInMinutes: 240
|
||||
cancelTimeoutInMinutes: 1
|
||||
@@ -134,6 +147,11 @@ jobs:
|
||||
sdk: true
|
||||
version: '6.0'
|
||||
|
||||
- template: steps-ensure-dotnet-version.yml
|
||||
parameters:
|
||||
sdk: true
|
||||
version: '8.0'
|
||||
|
||||
- template: steps-ensure-dotnet-version.yml
|
||||
parameters:
|
||||
sdk: true
|
||||
@@ -177,8 +195,15 @@ jobs:
|
||||
"packages.config" | "$(Agent.OS)"
|
||||
"packages.config"
|
||||
path: packages
|
||||
|
||||
- template: .\steps-restore-nuget.yml
|
||||
|
||||
- ${{ if eq(parameters.useLatestWinAppSDK, true)}}:
|
||||
- template: .\steps-update-winappsdk-and-restore-nuget.yml
|
||||
parameters:
|
||||
versionNumber: ${{ parameters.winAppSDKVersionNumber }}
|
||||
useExperimentalVersion: ${{ parameters.useExperimentalVersion }}
|
||||
|
||||
- ${{ if eq(parameters.useLatestWinAppSDK, false)}}:
|
||||
- template: .\steps-restore-nuget.yml
|
||||
|
||||
- pwsh: |-
|
||||
& "$(build.sourcesdirectory)\.pipelines\verifyAndSetLatestVCToolsVersion.ps1"
|
||||
@@ -209,6 +234,7 @@ jobs:
|
||||
${{ parameters.additionalBuildOptions }}
|
||||
$(MSBuildCacheParameters)
|
||||
/t:$(MSBuildMainBuildTargets)
|
||||
$(RestoreAdditionalProjectSourcesArg)
|
||||
platform: $(BuildPlatform)
|
||||
configuration: $(BuildConfiguration)
|
||||
msbuildArchitecture: x64
|
||||
@@ -233,10 +259,11 @@ jobs:
|
||||
inputs:
|
||||
solution: '**\HostsUILib.csproj'
|
||||
vsVersion: 17.0
|
||||
${{ if eq(parameters.useVSPreview, true) }}:
|
||||
msbuildArgs: /p:CIBuild=true;NoBuild=true -t:pack /bl:$(LogOutputDirectory)\build-hosts.binlog /p:NoWarn=NU5104
|
||||
${{ else }}:
|
||||
msbuildArgs: /p:CIBuild=true;NoBuild=true -t:pack /bl:$(LogOutputDirectory)\build-hosts.binlog
|
||||
msbuildArgs: >-
|
||||
/p:CIBuild=true;NoBuild=true -t:pack
|
||||
/bl:$(LogOutputDirectory)\build-hosts.binlog
|
||||
/p:NoWarn=NU5104
|
||||
$(RestoreAdditionalProjectSourcesArg)
|
||||
configuration: $(BuildConfiguration)
|
||||
msbuildArchitecture: x64
|
||||
maximumCpuCount: true
|
||||
@@ -249,10 +276,11 @@ jobs:
|
||||
inputs:
|
||||
solution: '**\EnvironmentVariablesUILib.csproj'
|
||||
vsVersion: 17.0
|
||||
${{ if eq(parameters.useVSPreview, true) }}:
|
||||
msbuildArgs: /p:CIBuild=true;NoBuild=true -t:pack /bl:$(LogOutputDirectory)\build-env-var-editor.binlog /p:NoWarn=NU5104
|
||||
${{ else }}:
|
||||
msbuildArgs: /p:CIBuild=true;NoBuild=true -t:pack /bl:$(LogOutputDirectory)\build-env-var-editor.binlog
|
||||
msbuildArgs: >-
|
||||
/p:CIBuild=true;NoBuild=true -t:pack
|
||||
/bl:$(LogOutputDirectory)\build-env-var-editor.binlog
|
||||
/p:NoWarn=NU5104
|
||||
$(RestoreAdditionalProjectSourcesArg)
|
||||
configuration: $(BuildConfiguration)
|
||||
msbuildArchitecture: x64
|
||||
maximumCpuCount: true
|
||||
@@ -265,10 +293,11 @@ jobs:
|
||||
inputs:
|
||||
solution: '**\RegistryPreviewUILib.csproj'
|
||||
vsVersion: 17.0
|
||||
${{ if eq(parameters.useVSPreview, true) }}:
|
||||
msbuildArgs: /p:CIBuild=true;NoBuild=true -t:pack /bl:$(LogOutputDirectory)\build-registry-preview.binlog /p:NoWarn=NU5104
|
||||
${{ else }}:
|
||||
msbuildArgs: /p:CIBuild=true;NoBuild=true -t:pack /bl:$(LogOutputDirectory)\build-registry-preview.binlog
|
||||
msbuildArgs: >-
|
||||
/p:CIBuild=true;NoBuild=true -t:pack
|
||||
/bl:$(LogOutputDirectory)\build-registry-preview.binlog
|
||||
/p:NoWarn=NU5104
|
||||
$(RestoreAdditionalProjectSourcesArg)
|
||||
configuration: $(BuildConfiguration)
|
||||
msbuildArchitecture: x64
|
||||
maximumCpuCount: true
|
||||
@@ -323,6 +352,7 @@ jobs:
|
||||
/bl:$(LogOutputDirectory)\build-bug-report.binlog
|
||||
${{ parameters.additionalBuildOptions }}
|
||||
$(MSBuildCacheParameters)
|
||||
$(RestoreAdditionalProjectSourcesArg)
|
||||
platform: $(BuildPlatform)
|
||||
configuration: $(BuildConfiguration)
|
||||
msbuildArchitecture: x64
|
||||
@@ -343,6 +373,7 @@ jobs:
|
||||
/bl:$(LogOutputDirectory)\build-webcam-report.binlog
|
||||
${{ parameters.additionalBuildOptions }}
|
||||
$(MSBuildCacheParameters)
|
||||
$(RestoreAdditionalProjectSourcesArg)
|
||||
platform: $(BuildPlatform)
|
||||
configuration: $(BuildConfiguration)
|
||||
msbuildArchitecture: x64
|
||||
@@ -363,6 +394,7 @@ jobs:
|
||||
/bl:$(LogOutputDirectory)\build-styles-report.binlog
|
||||
${{ parameters.additionalBuildOptions }}
|
||||
$(MSBuildCacheParameters)
|
||||
$(RestoreAdditionalProjectSourcesArg)
|
||||
platform: $(BuildPlatform)
|
||||
configuration: $(BuildConfiguration)
|
||||
msbuildArchitecture: x64
|
||||
@@ -385,6 +417,7 @@ jobs:
|
||||
/p:PowerToysRoot=$(Build.SourcesDirectory)
|
||||
/p:PublishProfile=InstallationPublishProfile.pubxml
|
||||
/bl:$(LogOutputDirectory)\publish-${{ join('_',split(project, '/')) }}.binlog
|
||||
$(RestoreAdditionalProjectSourcesArg)
|
||||
platform: $(BuildPlatform)
|
||||
configuration: $(BuildConfiguration)
|
||||
msbuildArchitecture: x64
|
||||
@@ -414,9 +447,11 @@ jobs:
|
||||
& '.pipelines/verifyPossibleAssetConflicts.ps1' -targetDir '$(build.sourcesdirectory)\$(BuildPlatform)\$(BuildConfiguration)\WinUI3Apps'
|
||||
displayName: Audit WinAppSDK applications path asset conflicts
|
||||
|
||||
- pwsh: |-
|
||||
& '.pipelines/verifyNoticeMdAgainstNugetPackages.ps1' -path '$(build.sourcesdirectory)\'
|
||||
displayName: Verify NOTICE.md and NuGet packages match
|
||||
# To streamline the pipeline and prevent errors, skip this step during compatibility tests with the latest WinAppSDK.
|
||||
- ${{ if eq(parameters.useLatestWinAppSDK, false) }}:
|
||||
- pwsh: |-
|
||||
& '.pipelines/verifyNoticeMdAgainstNugetPackages.ps1' -path '$(build.sourcesdirectory)\'
|
||||
displayName: Verify NOTICE.md and NuGet packages match
|
||||
|
||||
- ${{ if eq(parameters.runTests, true) }}:
|
||||
# Publish test results which ran in MSBuild
|
||||
|
||||
36
.pipelines/v2/templates/job-fuzz.yml
Normal file
36
.pipelines/v2/templates/job-fuzz.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
parameters:
|
||||
- name: configuration
|
||||
type: string
|
||||
default: "Release"
|
||||
- name: platform
|
||||
type: string
|
||||
default: ""
|
||||
- name: inputArtifactStem
|
||||
type: string
|
||||
default: ""
|
||||
|
||||
jobs:
|
||||
- job: OneFuzz
|
||||
pool:
|
||||
vmImage: windows-2022
|
||||
variables:
|
||||
ArtifactName: build-${{ parameters.platform }}-${{ parameters.configuration }}${{ parameters.inputArtifactStem }}
|
||||
steps:
|
||||
- checkout: self
|
||||
submodules: false
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
fetchTags: false
|
||||
|
||||
- download: current
|
||||
displayName: Download artifacts
|
||||
artifact: $(ArtifactName)
|
||||
patterns: |-
|
||||
**/tests/*.FuzzTests/**
|
||||
|
||||
- task: onefuzz-task@0
|
||||
inputs:
|
||||
onefuzzOSes: Windows
|
||||
env:
|
||||
onefuzzDropDirectory: $(Pipeline.Workspace)\$(ArtifactName)\x64\Release\x64\Release\tests
|
||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||
@@ -8,6 +8,9 @@ parameters:
|
||||
- name: inputArtifactStem
|
||||
type: string
|
||||
default: ""
|
||||
- name: useLatestWebView2
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
- job: Test${{ parameters.platform }}${{ parameters.configuration }}
|
||||
@@ -34,6 +37,29 @@ jobs:
|
||||
fetchDepth: 1
|
||||
fetchTags: false
|
||||
|
||||
- ${{ if eq(parameters.useLatestWebView2, true) }}:
|
||||
- powershell: |
|
||||
$edge_url = 'https://go.microsoft.com/fwlink/?linkid=2084649&Channel=Canary&language=en'
|
||||
$timeout = New-TimeSpan -Minutes 6
|
||||
$timeoutSeconds = [int]$timeout.TotalSeconds
|
||||
$command = {
|
||||
Invoke-WebRequest -Uri $using:edge_url -OutFile $(Pipeline.Workspace)\MicrosoftEdgeSetup.exe
|
||||
Write-Host "##[command]Installing Canary channel of Microsoft Edge"
|
||||
Start-Process $(Pipeline.Workspace)\MicrosoftEdgeSetup.exe -ArgumentList '/silent /install' -Wait
|
||||
}
|
||||
|
||||
$job = Start-Job -ScriptBlock $command
|
||||
Wait-Job $job -Timeout $timeoutSeconds
|
||||
if ($job.State -eq "Running") {
|
||||
Stop-Job $job
|
||||
Write-Host "##[warning]The job was stopped because it exceeded the time limit."
|
||||
}
|
||||
displayName: "Install the latest MSEdge Canary"
|
||||
|
||||
- script:
|
||||
reg add "HKLM\Software\Policies\Microsoft\Edge\WebView2\ReleaseChannels" /v PowerToys.exe /t REG_SZ /d "3"
|
||||
displayName: "Enable WebView2 Canary Channel"
|
||||
|
||||
- download: current
|
||||
displayName: Download artifacts
|
||||
artifact: build-${{ parameters.platform }}-${{ parameters.configuration }}${{ parameters.inputArtifactStem }}
|
||||
|
||||
@@ -22,6 +22,18 @@ parameters:
|
||||
- name: useVSPreview
|
||||
type: boolean
|
||||
default: false
|
||||
- name: useLatestWebView2
|
||||
type: boolean
|
||||
default: false
|
||||
- name: useLatestWinAppSDK
|
||||
type: boolean
|
||||
default: false
|
||||
- name: winAppSDKVersionNumber
|
||||
type: string
|
||||
default: 1.6
|
||||
- name: useExperimentalVersion
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
stages:
|
||||
# Allow manual builds to skip pre-check
|
||||
@@ -55,6 +67,10 @@ stages:
|
||||
enableMsBuildCaching: ${{ parameters.enableMsBuildCaching }}
|
||||
runTests: ${{ parameters.runTests }}
|
||||
useVSPreview: ${{ parameters.useVSPreview }}
|
||||
useLatestWinAppSDK: ${{ parameters.useLatestWinAppSDK }}
|
||||
${{ if eq(parameters.useLatestWinAppSDK, true) }}:
|
||||
winAppSDKVersionNumber: ${{ parameters.winAppSDKVersionNumber }}
|
||||
useExperimentalVersion: ${{ parameters.useExperimentalVersion }}
|
||||
|
||||
- ${{ if eq(parameters.runTests, true) }}:
|
||||
- stage: Test_${{ platform }}
|
||||
@@ -66,3 +82,4 @@ stages:
|
||||
parameters:
|
||||
platform: ${{ platform }}
|
||||
configuration: Release
|
||||
useLatestWebView2: ${{ parameters.useLatestWebView2 }}
|
||||
|
||||
@@ -16,6 +16,10 @@ parameters:
|
||||
steps:
|
||||
- pwsh: |-
|
||||
curl.exe -J -L -O "https://dot.net/v1/dotnet-install.ps1"
|
||||
if (-not (Test-Path dotnet-install.ps1)) {
|
||||
Write-Error "Failed to download dotnet-install.ps1"
|
||||
exit 1
|
||||
}
|
||||
$NEW_DOTNET_ROOT = "$(Agent.ToolsDirectory)\dotnet"
|
||||
& ./dotnet-install.ps1 -Channel "${{parameters.version}}" -InstallDir $NEW_DOTNET_ROOT
|
||||
Write-Host "##vso[task.setvariable variable=DOTNET_ROOT]${NEW_DOTNET_ROOT}"
|
||||
@@ -25,3 +29,4 @@ steps:
|
||||
displayName: "Install .NET ${{parameters.version}} SDK"
|
||||
${{ else }}:
|
||||
displayName: "Install .NET ${{parameters.version}}"
|
||||
retryCountOnTaskFailure: 3
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
parameters:
|
||||
- name: versionNumber
|
||||
type: string
|
||||
default: 1.6
|
||||
- name: useExperimentalVersion
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
steps:
|
||||
- task: NuGetAuthenticate@1
|
||||
displayName: 'NuGet Authenticate'
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: Update WinAppSDK Versions
|
||||
inputs:
|
||||
filePath: '$(build.sourcesdirectory)\.pipelines\UpdateVersions.ps1'
|
||||
arguments: >
|
||||
-winAppSdkVersionNumber ${{ parameters.versionNumber }}
|
||||
-useExperimentalVersion $${{ parameters.useExperimentalVersion }}
|
||||
|
||||
- script: echo $(WinAppSDKVersion)
|
||||
displayName: 'Display WinAppSDK Version Found'
|
||||
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: 'Download WindowsAppSDK'
|
||||
inputs:
|
||||
buildType: 'specific'
|
||||
project: '55e8140e-57ac-4e5f-8f9c-c7c15b51929d'
|
||||
definition: '104083'
|
||||
buildVersionToDownload: 'latestFromBranch'
|
||||
branchName: 'refs/heads/release/${{ parameters.versionNumber }}-stable'
|
||||
artifactName: 'WindowsAppSDK_Nuget_And_MSIX'
|
||||
targetPath: '$(Build.SourcesDirectory)\localpackages'
|
||||
|
||||
- script: dir $(Build.SourcesDirectory)\localpackages\NugetPackages
|
||||
displayName: 'List downloaded packages'
|
||||
|
||||
- task: NuGetCommand@2
|
||||
displayName: 'Install WindowsAppSDK'
|
||||
inputs:
|
||||
command: 'custom'
|
||||
arguments: >
|
||||
install "Microsoft.WindowsAppSDK"
|
||||
-Source "$(Build.SourcesDirectory)\localpackages\NugetPackages"
|
||||
-Version "$(WinAppSDKVersion)"
|
||||
-OutputDirectory "$(Build.SourcesDirectory)\localpackages\output"
|
||||
-FallbackSource "https://microsoft.pkgs.visualstudio.com/ProjectReunion/_packaging/Project.Reunion.nuget.internal/nuget/v3/index.json"
|
||||
|
||||
- task: NuGetCommand@2
|
||||
displayName: 'Restore NuGet packages'
|
||||
inputs:
|
||||
command: 'restore'
|
||||
feedsToUse: 'config'
|
||||
nugetConfigPath: '$(build.sourcesdirectory)\nuget.config'
|
||||
restoreSolution: '$(build.sourcesdirectory)\**\*.sln'
|
||||
includeNuGetOrg: false
|
||||
@@ -15,7 +15,7 @@ Param(
|
||||
$referencedFileVersionsPerDll = @{}
|
||||
$totalFailures = 0
|
||||
|
||||
Get-ChildItem $targetDir -Recurse -Filter *.deps.json -Exclude UITests-FancyZones*,MouseJump.Common.UnitTests* | ForEach-Object {
|
||||
Get-ChildItem $targetDir -Recurse -Filter *.deps.json -Exclude UITests-FancyZones*,MouseJump.Common.UnitTests*,AdvancedPaste.FuzzTests* | ForEach-Object {
|
||||
# Temporarily exclude FancyZones UI tests because of Appium.WebDriver dependencies
|
||||
$depsJsonFullFileName = $_.FullName
|
||||
$depsJsonFileName = $_.Name
|
||||
|
||||
@@ -181,6 +181,14 @@ Other contributors:
|
||||
- [@shuaiyuanxx](https://github.com/shuaiyuanxx) - Shawn Yuan - Dev
|
||||
- [@moooyo](https://github.com/moooyo) - Yu Leng - Dev
|
||||
- [@haoliuu](https://github.com/haoliuu) - Hao Liu - Dev
|
||||
- [@chenmy77](https://github.com/chenmy77) - Mengyuan Chen - Dev
|
||||
- [@chemwolf6922](https://github.com/chemwolf6922) - Feng Wang - Dev
|
||||
- [@yaqingmi](https://github.com/yaqingmi) - Yaqing Mi - Dev
|
||||
- [@zhaoqpcn](https://github.com/zhaoqpcn) - Qingpeng Zhao - Dev
|
||||
- [@urnotdfs](https://github.com/urnotdfs) - Xiaofeng Wang - Dev
|
||||
- [@zhaopy536](https://github.com/zhaopy536) - Peiyao Zhao - Dev
|
||||
- [@wang563681252](https://github.com/wang563681252) - Zhaopeng Wang - Dev
|
||||
- [@vanzue](https://github.com/vanzue) - Kai Tao - Dev
|
||||
|
||||
# Former PowerToys core team members
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<PackageVersion Include="hyjiacan.pinyin4net" Version="4.1.1" />
|
||||
<PackageVersion Include="Interop.Microsoft.Office.Interop.OneNote" Version="1.1.0.2" />
|
||||
<PackageVersion Include="LazyCache" Version="2.4.0" />
|
||||
<PackageVersion Include="Mages" Version="2.0.2" />
|
||||
<PackageVersion Include="Mages" Version="3.0.0" />
|
||||
<PackageVersion Include="Markdig.Signed" Version="0.34.0" />
|
||||
<!-- Including MessagePack to force version, since it's used by StreamJsonRpc but contains vulnerabilities. After StreamJsonRpc updates the version of MessagePack, we can upgrade StreamJsonRpc instead. -->
|
||||
<PackageVersion Include="MessagePack" Version="2.5.187" />
|
||||
|
||||
@@ -1315,7 +1315,7 @@ EXHIBIT A -Mozilla Public License.
|
||||
- hyjiacan.pinyin4net 4.1.1
|
||||
- Interop.Microsoft.Office.Interop.OneNote 1.1.0.2
|
||||
- LazyCache 2.4.0
|
||||
- Mages 2.0.2
|
||||
- Mages 3.0.0
|
||||
- Markdig.Signed 0.34.0
|
||||
- MessagePack 2.5.187
|
||||
- Microsoft.Bcl.AsyncInterfaces 9.0.0
|
||||
|
||||
@@ -179,7 +179,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
||||
Directory.Build.targets = Directory.Build.targets
|
||||
Directory.Packages.props = Directory.Packages.props
|
||||
src\Monaco.props = src\Monaco.props
|
||||
Solution.props = Solution.props
|
||||
src\Solution.props = src\Solution.props
|
||||
src\Version.props = src\Version.props
|
||||
EndProjectSection
|
||||
EndProject
|
||||
@@ -637,6 +637,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NewPlus.ShellExtension.win1
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdvancedPaste.UnitTests", "src\modules\AdvancedPaste\AdvancedPaste.UnitTests\AdvancedPaste.UnitTests.csproj", "{D5E5F5EA-1B6C-4A73-88BE-304F36C9E4EE}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdvancedPaste.FuzzTests", "src\modules\AdvancedPaste\AdvancedPaste.FuzzTests\AdvancedPaste.FuzzTests.csproj", "{7F5B9557-5878-4438-A721-3E28296BA193}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|ARM64 = Debug|ARM64
|
||||
@@ -2821,6 +2823,18 @@ Global
|
||||
{D5E5F5EA-1B6C-4A73-88BE-304F36C9E4EE}.Release|x64.Build.0 = Release|x64
|
||||
{D5E5F5EA-1B6C-4A73-88BE-304F36C9E4EE}.Release|x86.ActiveCfg = Release|x64
|
||||
{D5E5F5EA-1B6C-4A73-88BE-304F36C9E4EE}.Release|x86.Build.0 = Release|x64
|
||||
{7F5B9557-5878-4438-A721-3E28296BA193}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{7F5B9557-5878-4438-A721-3E28296BA193}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{7F5B9557-5878-4438-A721-3E28296BA193}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{7F5B9557-5878-4438-A721-3E28296BA193}.Debug|x64.Build.0 = Debug|x64
|
||||
{7F5B9557-5878-4438-A721-3E28296BA193}.Debug|x86.ActiveCfg = Debug|x64
|
||||
{7F5B9557-5878-4438-A721-3E28296BA193}.Debug|x86.Build.0 = Debug|x64
|
||||
{7F5B9557-5878-4438-A721-3E28296BA193}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{7F5B9557-5878-4438-A721-3E28296BA193}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{7F5B9557-5878-4438-A721-3E28296BA193}.Release|x64.ActiveCfg = Release|x64
|
||||
{7F5B9557-5878-4438-A721-3E28296BA193}.Release|x64.Build.0 = Release|x64
|
||||
{7F5B9557-5878-4438-A721-3E28296BA193}.Release|x86.ActiveCfg = Release|x64
|
||||
{7F5B9557-5878-4438-A721-3E28296BA193}.Release|x86.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -3055,6 +3069,7 @@ Global
|
||||
{89D0E199-B17A-418C-B2F8-7375B6708357} = {A2221D7E-55E7-4BEA-90D1-4F162D670BBF}
|
||||
{0DB0F63A-D2F8-4DA3-A650-2D0B8724218E} = {CA716AE6-FE5C-40AC-BB8F-2C87912687AC}
|
||||
{D5E5F5EA-1B6C-4A73-88BE-304F36C9E4EE} = {9873BA05-4C41-4819-9283-CF45D795431B}
|
||||
{7F5B9557-5878-4438-A721-3E28296BA193} = {9873BA05-4C41-4819-9283-CF45D795431B}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {C3A2F9D1-7930-4EF4-A6FC-7EE0A99821D0}
|
||||
|
||||
26
README.md
26
README.md
@@ -1,6 +1,6 @@
|
||||
# Microsoft PowerToys
|
||||
|
||||

|
||||

|
||||
|
||||
[How to use PowerToys][usingPowerToys-docs-link] | [Downloads & Release notes][github-release-link] | [Contributing to PowerToys](#contributing) | [What's Happening](#whats-happening) | [Roadmap](#powertoys-roadmap)
|
||||
|
||||
@@ -20,12 +20,6 @@ Microsoft PowerToys is a set of utilities for power users to tune and streamline
|
||||
| [Registry Preview](https://aka.ms/PowerToysOverview_RegistryPreview) | [Screen Ruler](https://aka.ms/PowerToysOverview_ScreenRuler) | [Shortcut Guide](https://aka.ms/PowerToysOverview_ShortcutGuide) |
|
||||
| [Text Extractor](https://aka.ms/PowerToysOverview_TextExtractor) | [Video Conference Mute](https://aka.ms/PowerToysOverview_VideoConference) | [Workspaces](https://aka.ms/PowerToysOverview_Workspaces) |
|
||||
|
||||
## 🎁⭐ PowerToys Advent calendar ⭐🎁
|
||||
|
||||
We will be highlighting a cool utility each day for 24 days in December! To follow along, check out these threads:
|
||||
- https://bsky.app/profile/kaylacinnamon.bsky.social/post/3lcb7iljxck2o
|
||||
- https://x.com/cinnamon_msft/status/1863284610773246257
|
||||
|
||||
## Installing and running Microsoft PowerToys
|
||||
|
||||
### Requirements
|
||||
@@ -42,17 +36,17 @@ Go to the [Microsoft PowerToys GitHub releases page][github-release-link] and cl
|
||||
<!-- items that need to be updated release to release -->
|
||||
[github-next-release-work]: https://github.com/microsoft/PowerToys/issues?q=is%3Aissue+milestone%3A%22PowerToys+0.88%22
|
||||
[github-current-release-work]: https://github.com/microsoft/PowerToys/issues?q=is%3Aissue+milestone%3A%22PowerToys+0.87%22
|
||||
[ptUserX64]: https://github.com/microsoft/PowerToys/releases/download/v0.87.0/PowerToysUserSetup-0.87.0-x64.exe
|
||||
[ptUserArm64]: https://github.com/microsoft/PowerToys/releases/download/v0.87.0/PowerToysUserSetup-0.87.0-arm64.exe
|
||||
[ptMachineX64]: https://github.com/microsoft/PowerToys/releases/download/v0.87.0/PowerToysSetup-0.87.0-x64.exe
|
||||
[ptMachineArm64]: https://github.com/microsoft/PowerToys/releases/download/v0.87.0/PowerToysSetup-0.87.0-arm64.exe
|
||||
|
||||
[ptUserX64]: https://github.com/microsoft/PowerToys/releases/download/v0.87.1/PowerToysUserSetup-0.87.1-x64.exe
|
||||
[ptUserArm64]: https://github.com/microsoft/PowerToys/releases/download/v0.87.1/PowerToysUserSetup-0.87.1-arm64.exe
|
||||
[ptMachineX64]: https://github.com/microsoft/PowerToys/releases/download/v0.87.1/PowerToysSetup-0.87.1-x64.exe
|
||||
[ptMachineArm64]: https://github.com/microsoft/PowerToys/releases/download/v0.87.1/PowerToysSetup-0.87.1-arm64.exe
|
||||
|
||||
| Description | Filename | sha256 hash |
|
||||
|----------------|----------|-------------|
|
||||
| Per user - x64 | [PowerToysUserSetup-0.87.0-x64.exe][ptUserX64] | A6549B8D78985CC995F091624D1A2B70907CAC8954334C1CAF61D26EBCF8A449 |
|
||||
| Per user - ARM64 | [PowerToysUserSetup-0.87.0-arm64.exe][ptUserArm64] | 3557D4F35AA52571334712A48F51D116F389FA8C43C6B27FE321A7525067E7AE |
|
||||
| Machine wide - x64 | [PowerToysSetup-0.87.0-x64.exe][ptMachineX64] | 600CDC7F9AC296AA8B554CA34A0C7EA2D9B1E7E8E41BD096840851B416E63A3C |
|
||||
| Machine wide - ARM64 | [PowerToysSetup-0.87.0-arm64.exe][ptMachineArm64] | 387B5BF1BD923BDA215D7DF1D82A197AE12CD91A71A73267768E26757F7A5FE6 |
|
||||
| Per user - x64 | [PowerToysUserSetup-0.87.1-x64.exe][ptUserX64] | 8EFAF47ED00BF230D2C2CC3CB6765C903A6A47E0AAED0BBB329CEF918207B486 |
|
||||
| Per user - ARM64 | [PowerToysUserSetup-0.87.1-arm64.exe][ptUserArm64] | 212FC8055789BD2DC4DE554B9AEE291A9C077907E263A302939266263A9D512B |
|
||||
| Machine wide - x64 | [PowerToysSetup-0.87.1-x64.exe][ptMachineX64] | 69AD65DDAC6436AEF292D2CC6AB1530021CE98083CB3F5FD3380A52A3B0DBB9A |
|
||||
| Machine wide - ARM64 | [PowerToysSetup-0.87.1-arm64.exe][ptMachineArm64] | AEC9F1D02F1E23F0C1FCFDF95C337C962902394F44C0568012DF78BEDB45CF19 |
|
||||
|
||||
This is our preferred method.
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
"Author": string,
|
||||
"Version": "1.0.0", // For future compatibility
|
||||
"Language": "csharp", // So far we support only csharp
|
||||
"Website": "https://aka.ms/powertoys",
|
||||
"Website": "https://aka.ms/powertoys", // Has to be an absolute uri starting with "http://" or "https://".
|
||||
"ExecuteFileName": string, // Should be {Type}.PowerToys.Run.Plugin.{PluginName}.dll
|
||||
"IcoPathDark": string, // Path to dark theme icon. The path is relative to the root plugin folder
|
||||
"IcoPathLight": string // Path to light theme icon. The path is relative to the root plugin folder
|
||||
@@ -42,3 +42,4 @@ In the PR that adds a new plugin, reference a new issue to track the work for fu
|
||||
|
||||
- [ ] Add the resource folder to https://github.com/microsoft/PowerToys/blob/21247c0bb09a1bee3d14d6efa53d0c247f7236af/installer/PowerToysSetup/Product.wxs#L825
|
||||
- [ ] Add the resource files under the section https://github.com/microsoft/PowerToys/blob/21247c0bb09a1bee3d14d6efa53d0c247f7236af/installer/PowerToysSetup/Product.wxs#L882
|
||||
- [ ] Your plugin's executable file (DLL) has to have correct version informations after building it. (This version information will be shown on the settings page.)
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 503 KiB |
@@ -7,7 +7,7 @@ import { srtDefinition } from './customLanguages/srt.js';
|
||||
export async function registerAdditionalLanguages(monaco){
|
||||
await languageDefinitions();
|
||||
registerAdditionalLanguage("cppExt", [".ino", ".pde"], "cpp", monaco);
|
||||
registerAdditionalLanguage("xmlExt", [".wsdl", ".csproj", ".vcxproj", ".vbproj", ".fsproj"], "xml", monaco);
|
||||
registerAdditionalLanguage("xmlExt", [".wsdl", ".csproj", ".vcxproj", ".vbproj", ".fsproj", ".resx", ".resw"], "xml", monaco);
|
||||
registerAdditionalLanguage("txtExt", [".sln", ".log", ".vsconfig", ".env", ".ahk", ".ion"], "txt", monaco);
|
||||
registerAdditionalLanguage("razorExt", [".razor"], "razor", monaco);
|
||||
registerAdditionalLanguage("vbExt", [".vbs"], "vb", monaco);
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -2,6 +2,7 @@
|
||||
<!-- Look at Directory.Build.props in root for common stuff as well -->
|
||||
<Import Project="..\..\Common.Dotnet.CsWinRT.props" />
|
||||
<Import Project="..\..\Monaco.props" />
|
||||
<Import Project="..\..\Common.Dotnet.AotCompatibility.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<Description>PowerToys FilePreviewCommon</Description>
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
// 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 System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Microsoft.PowerToys.FilePreviewCommon.Monaco.Formatters;
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(JsonDocument))]
|
||||
internal sealed partial class FilePreviewJsonSerializerContext : JsonSerializerContext
|
||||
{
|
||||
}
|
||||
@@ -14,7 +14,6 @@ namespace Microsoft.PowerToys.FilePreviewCommon.Monaco.Formatters
|
||||
|
||||
private static readonly JsonSerializerOptions _serializerOptions = new JsonSerializerOptions
|
||||
{
|
||||
WriteIndented = true,
|
||||
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
|
||||
};
|
||||
|
||||
@@ -28,7 +27,8 @@ namespace Microsoft.PowerToys.FilePreviewCommon.Monaco.Formatters
|
||||
|
||||
using (var jDocument = JsonDocument.Parse(value, new JsonDocumentOptions { CommentHandling = JsonCommentHandling.Skip }))
|
||||
{
|
||||
return JsonSerializer.Serialize(jDocument, _serializerOptions);
|
||||
FilePreviewJsonSerializerContext context = new(_serializerOptions);
|
||||
return JsonSerializer.Serialize(jDocument, context.JsonDocument);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Text.Json;
|
||||
|
||||
using Microsoft.PowerToys.FilePreviewCommon.Monaco.Formatters;
|
||||
|
||||
namespace Microsoft.PowerToys.FilePreviewCommon
|
||||
@@ -38,15 +36,15 @@ namespace Microsoft.PowerToys.FilePreviewCommon
|
||||
|
||||
private static string GetRuntimeMonacoDirectory()
|
||||
{
|
||||
string exePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty;
|
||||
string baseDirectory = AppContext.BaseDirectory ?? string.Empty;
|
||||
|
||||
// If the executable is within "WinUI3Apps", correct the path first.
|
||||
if (Path.GetFileName(exePath) == "WinUI3Apps")
|
||||
if (Path.GetFileName(baseDirectory) == "WinUI3Apps")
|
||||
{
|
||||
exePath = Path.Combine(exePath, "..");
|
||||
baseDirectory = Path.Combine(baseDirectory, "..");
|
||||
}
|
||||
|
||||
string monacoPath = Path.Combine(exePath, "Assets", "Monaco");
|
||||
string monacoPath = Path.Combine(baseDirectory, "Assets", "Monaco");
|
||||
|
||||
return Directory.Exists(monacoPath) ?
|
||||
monacoPath :
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OutputPath>..\..\..\..\$(Platform)\$(Configuration)\tests\AdvancedPaste.FuzzTests\</OutputPath>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\AdvancedPaste\Helpers\JsonHelper.cs" Link="JsonHelper.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MSTest" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="OneFuzzConfig.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
45
src/modules/AdvancedPaste/AdvancedPaste.FuzzTests/Fuzz.md
Normal file
45
src/modules/AdvancedPaste/AdvancedPaste.FuzzTests/Fuzz.md
Normal file
@@ -0,0 +1,45 @@
|
||||
# Fuzzing .NET Code with OneFuzz
|
||||
|
||||
This document explains the purpose of the project, the rationale for using specific technologies, and key instructions for fuzz testing .NET code using OneFuzz.
|
||||
|
||||
## Overview
|
||||
|
||||
This project demonstrates fuzz testing for .NET applications. It uses a `.NET 8 (Windows)` project where a code file is linked to the project. The linked file contains the functions required for fuzz testing.
|
||||
|
||||
## Why Use .NET 8 (Windows)?
|
||||
|
||||
1. **Current Support**: At the time of writing, OneFuzz supports only .NET 8 projects. The Fuzz team is actively working on .NET 9 support.
|
||||
2. **Interim Solution**: Until .NET 9 support is available, .NET 8 serves as a robust and temporary solution for fuzz testing, enabling direct code linking for efficient development.
|
||||
|
||||
## Requesting Access
|
||||
|
||||
To log into the production instance of OneFuzz with the CLI, you **must request access**. Visit the internal [OneFuzz Access Request Page](https://myaccess.microsoft.com/@microsoft.onmicrosoft.com#/access-packages/6df691eb-e3d1-444b-b4b2-9e944dc794be) for details.
|
||||
|
||||
## How to Fuzz .NET Code
|
||||
|
||||
To set up and run fuzz testing on .NET code, follow the detailed guide available [Fuzz .NET Code](https://eng.ms/docs/cloud-ai-platform/azure-edge-platform-aep/aep-security/epsf-edge-and-platform-security-fundamentals/the-onefuzz-service/onefuzz/howto/fuzzing-dotnet-code).
|
||||
|
||||
## Running a .NET Fuzz Target Locally
|
||||
|
||||
Testing a .NET fuzz target locally requires specific configurations. For a step-by-step guide, see the section on [Running a .NET Fuzz Target Locally](https://eng.ms/docs/cloud-ai-platform/azure-edge-platform-aep/aep-security/epsf-edge-and-platform-security-fundamentals/the-onefuzz-service/onefuzz/howto/fuzzing-dotnet-code#extra-running-a-net-fuzz-target-locally).
|
||||
|
||||
## Writing a Good OneFuzzConfig.json
|
||||
|
||||
The `OneFuzzConfig.json` file provides critical information for deploying fuzzing jobs using the OneFuzz Ingestion Preparation Tool and Ingestion Service.
|
||||
|
||||
### Structure
|
||||
|
||||
The primary structure is an array of configuration entries. Outside the array, the `configVersion` field is used to track changes to the configuration schema.
|
||||
|
||||
For more details on how to write and structure this file, see the [OneFuzzConfig V3 Documentation](https://eng.ms/docs/cloud-ai-platform/azure-edge-platform-aep/aep-security/epsf-edge-and-platform-security-fundamentals/the-onefuzz-service/onefuzz/onefuzzconfig/onefuzzconfigv3).
|
||||
|
||||
## Tools
|
||||
|
||||
### OneFuzz Ingestion Preparation (OIP) Tool
|
||||
|
||||
The OIP tool helps prepare data for ingestion and fuzz testing. Learn more about [OneFuzz Ingestion Preparation (OIP) Tool](https://eng.ms/docs/cloud-ai-platform/azure-edge-platform-aep/aep-security/epsf-edge-and-platform-security-fundamentals/the-onefuzz-service/onefuzz/oip/onefuzzingestionpreparationtool).
|
||||
|
||||
### OneFuzz CLI
|
||||
|
||||
The CLI provides commands to manage and execute fuzzing jobs. Download and set up the CLI by following this [guide](https://eng.ms/docs/cloud-ai-platform/azure-edge-platform-aep/aep-security/epsf-edge-and-platform-security-fundamentals/the-onefuzz-service/onefuzz/howto/downloading-cli).
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
// 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 AdvancedPaste.Helpers;
|
||||
using Windows.ApplicationModel.DataTransfer;
|
||||
|
||||
// OneFuzz currently does not support .NET 9 code testing, so this is a temporary solution.
|
||||
// Create a .NET 8 project and use a file link to include the code for testing first.
|
||||
namespace AdvancedPaste.FuzzTests
|
||||
{
|
||||
public class FuzzTests
|
||||
{
|
||||
public static void FuzzToJsonFromXmlOrCsv(ReadOnlySpan<byte> input)
|
||||
{
|
||||
try
|
||||
{
|
||||
var dataPackage = new DataPackage();
|
||||
dataPackage.SetText(input.ToString());
|
||||
_ = Task.Run(async () => await JsonHelper.ToJsonFromXmlOrCsvAsync(dataPackage.GetView())).Result;
|
||||
}
|
||||
catch (Exception ex) when (ex is ArgumentException)
|
||||
{
|
||||
// This is an example. It's important to filter out any *expected* exceptions from our code here.
|
||||
// However, catching all exceptions is considered an anti-pattern because it may suppress legitimate
|
||||
// issues, such as a NullReferenceException thrown by our code. In this case, we still re-throw
|
||||
// the exception, as the ToJsonFromXmlOrCsvAsync method is not expected to throw any exceptions.
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
46
src/modules/AdvancedPaste/AdvancedPaste.FuzzTests/Logger.cs
Normal file
46
src/modules/AdvancedPaste/AdvancedPaste.FuzzTests/Logger.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
// 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 System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
// This is used for fuzz testing and ensures that the project links only to JsonHelper,
|
||||
// avoiding unnecessary connections to additional files
|
||||
namespace ManagedCommon
|
||||
{
|
||||
public static class Logger
|
||||
{
|
||||
// An empty method to simulate logging information
|
||||
public static void LogTrace()
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
// An empty method to simulate logging information
|
||||
public static void LogInfo(string message)
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
// An empty method to simulate logging warnings
|
||||
public static void LogWarning(string message)
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
// An empty method to simulate logging errors
|
||||
public static void LogError(string message, Exception? ex = null)
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
public static void LogDebug(string message, Exception? ex = null)
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// 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.
|
||||
|
||||
[assembly: Parallelize(Scope = ExecutionScope.MethodLevel)]
|
||||
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"configVersion": 3,
|
||||
"entries": [
|
||||
{
|
||||
"fuzzer": {
|
||||
"$type": "libfuzzerDotNet",
|
||||
"dll": "AdvancedPaste.FuzzTests.dll",
|
||||
"class": "AdvancedPaste.FuzzTests.FuzzTests",
|
||||
"method": "FuzzToJsonFromXmlOrCsv",
|
||||
"FuzzingTargetBinaries": [
|
||||
"PowerToys.AdvancedPaste.dll"
|
||||
]
|
||||
},
|
||||
"adoTemplate": {
|
||||
// supply the values appropriate to your
|
||||
// project, where bugs will be filed
|
||||
"org": "microsoft",
|
||||
"project": "OS",
|
||||
"AssignedTo": "leilzh@microsoft.com",
|
||||
"AreaPath": "OS\\Windows Client and Services\\WinPD\\DEEP-Developer Experience, Ecosystem and Partnerships\\SHINE\\PowerToys",
|
||||
"IterationPath": "OS\\Future"
|
||||
},
|
||||
"jobNotificationEmail": "leilzh@microsoft.com",
|
||||
"skip": false,
|
||||
"rebootAfterSetup": false,
|
||||
"oneFuzzJobs": [
|
||||
// at least one job is required
|
||||
{
|
||||
"projectName": "AdvancedPaste",
|
||||
"targetName": "AdvancedPaste-dotnet-fuzzer"
|
||||
}
|
||||
],
|
||||
"jobDependencies": [
|
||||
// this should contain, at minimum,
|
||||
// the DLL and PDB files
|
||||
// you will need to add any other files required
|
||||
// (globs are supported)
|
||||
"AdvancedPaste.FuzzTests.dll",
|
||||
"AdvancedPaste.FuzzTests.pdb",
|
||||
"Microsoft.Windows.SDK.NET.dll",
|
||||
"Newtonsoft.Json.dll",
|
||||
"WinRT.Runtime.dll"
|
||||
],
|
||||
"SdlWorkItemId": 49911822
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
@@ -33,6 +34,19 @@ namespace AdvancedPaste.Helpers
|
||||
private static readonly Regex CsvRemoveStartAndEndQuotationMarksRegex = new Regex(@"^""(?=(""{2})+)|(?<=(""{2})+)""$");
|
||||
private static readonly Regex CsvReplaceDoubleQuotationMarksRegex = new Regex(@"""{2}");
|
||||
|
||||
private static bool IsJson(string text)
|
||||
{
|
||||
try
|
||||
{
|
||||
_ = JsonDocument.Parse(text);
|
||||
return true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
internal static async Task<string> ToJsonFromXmlOrCsvAsync(DataPackageView clipboardData)
|
||||
{
|
||||
Logger.LogTrace();
|
||||
@@ -46,6 +60,12 @@ namespace AdvancedPaste.Helpers
|
||||
var text = await clipboardData.GetTextAsync();
|
||||
string jsonText = string.Empty;
|
||||
|
||||
// If the text is already JSON, return it
|
||||
if (IsJson(text))
|
||||
{
|
||||
return text;
|
||||
}
|
||||
|
||||
// Try convert XML
|
||||
try
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ using Microsoft.UI.Dispatching;
|
||||
|
||||
namespace HostsUILib.Helpers
|
||||
{
|
||||
public class DuplicateService : IDuplicateService, IDisposable
|
||||
public partial class DuplicateService : IDuplicateService, IDisposable
|
||||
{
|
||||
private record struct Check(string Address, string[] Hosts);
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ using Microsoft.Win32;
|
||||
|
||||
namespace HostsUILib.Helpers
|
||||
{
|
||||
public class HostsService : IHostsService, IDisposable
|
||||
public partial class HostsService : IHostsService, IDisposable
|
||||
{
|
||||
private const string _backupSuffix = $"_PowerToysBackup_";
|
||||
private const int _defaultBufferSize = 4096; // From System.IO.File source code
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<!-- Look at Directory.Build.props in root for common stuff as well -->
|
||||
<Import Project="..\..\..\Common.Dotnet.CsWinRT.props" />
|
||||
<Import Project="..\..\..\Common.Dotnet.AotCompatibility.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Library</OutputType>
|
||||
|
||||
@@ -38,9 +38,9 @@ IFACEMETHODIMP shell_context_menu_win10::QueryContextMenu(HMENU menu_handle, UIN
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (menu_flags & CMF_DEFAULTONLY)
|
||||
if (menu_flags & (CMF_DEFAULTONLY | CMF_VERBSONLY | CMF_OPTIMIZEFORINVOKE))
|
||||
{
|
||||
return MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, 0);
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
try
|
||||
@@ -217,6 +217,13 @@ IFACEMETHODIMP shell_context_menu_win10::InvokeCommand(CMINVOKECOMMANDINFO* para
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (HIWORD(params->lpVerb)!=0)
|
||||
{
|
||||
// Not a menu command. It's likely a string verb command from another menu.
|
||||
// The logic to interpret lpVerb is explained here: https://learn.microsoft.com/en-us/previous-versions//bb776881(v=vs.85)#invokecommand-method
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
// Get selected menu item (a template or the "Open templates" item)
|
||||
const auto selected_menu_item_index = LOWORD(params->lpVerb) - 1;
|
||||
if (selected_menu_item_index < 0)
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
<Border
|
||||
x:Name="TopButtonsStackPanel"
|
||||
Margin="12"
|
||||
Padding="4,8,12,8"
|
||||
Padding="4,8,4,8"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top"
|
||||
d:Visibility="Visible"
|
||||
@@ -116,7 +116,6 @@
|
||||
Orientation="Horizontal">
|
||||
<ComboBox
|
||||
x:Name="LanguagesComboBox"
|
||||
Height="32"
|
||||
Margin="4,0"
|
||||
AutomationProperties.Name="{x:Static p:Resources.SelectedLang}"
|
||||
SelectionChanged="LanguagesComboBox_SelectionChanged">
|
||||
@@ -156,6 +155,7 @@
|
||||
</Button>
|
||||
<Button
|
||||
x:Name="CancelButton"
|
||||
AutomationProperties.Name="{x:Static p:Resources.Cancel}"
|
||||
Click="CancelMenuItem_Click"
|
||||
ToolTip="{x:Static p:Resources.CancelShortcut}">
|
||||
<ui:SymbolIcon FontSize="18" Symbol="Dismiss24" />
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
@@ -76,7 +77,7 @@ public partial class OCROverlay : Window
|
||||
if (string.IsNullOrEmpty(selectedLanguageName))
|
||||
{
|
||||
selectedLanguage = ImageMethods.GetOCRLanguage();
|
||||
selectedLanguageName = selectedLanguage?.DisplayName;
|
||||
selectedLanguageName = selectedLanguage?.NativeName;
|
||||
}
|
||||
|
||||
List<Language> possibleOcrLanguages = OcrEngine.AvailableRecognizerLanguages.ToList();
|
||||
@@ -85,10 +86,10 @@ public partial class OCROverlay : Window
|
||||
|
||||
foreach (Language language in possibleOcrLanguages)
|
||||
{
|
||||
MenuItem menuItem = new() { Header = language.NativeName, Tag = language, IsCheckable = true };
|
||||
menuItem.IsChecked = language.DisplayName.Equals(selectedLanguageName, StringComparison.Ordinal);
|
||||
LanguagesComboBox.Items.Add(language);
|
||||
if (language.DisplayName.Equals(selectedLanguageName, StringComparison.Ordinal))
|
||||
MenuItem menuItem = new() { Header = EnsureStartUpper(language.NativeName), Tag = language, IsCheckable = true };
|
||||
menuItem.IsChecked = language.NativeName.Equals(selectedLanguageName, StringComparison.OrdinalIgnoreCase);
|
||||
LanguagesComboBox.Items.Add(new ComboBoxItem { Content = EnsureStartUpper(language.NativeName), Tag = language });
|
||||
if (language.NativeName.Equals(selectedLanguageName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
selectedLanguage = language;
|
||||
LanguagesComboBox.SelectedIndex = count;
|
||||
@@ -358,7 +359,12 @@ public partial class OCROverlay : Window
|
||||
|
||||
// TODO: Set the preferred language based upon what was chosen here
|
||||
int selection = languageComboBox.SelectedIndex;
|
||||
selectedLanguage = languageComboBox.SelectedItem as Language;
|
||||
selectedLanguage = (languageComboBox.SelectedItem as ComboBoxItem)?.Tag as Language;
|
||||
|
||||
if (selectedLanguage == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Logger.LogError($"Changed language to {selectedLanguage?.LanguageTag}");
|
||||
|
||||
@@ -499,4 +505,16 @@ public partial class OCROverlay : Window
|
||||
{
|
||||
return screenRectangle;
|
||||
}
|
||||
|
||||
private string EnsureStartUpper(string input)
|
||||
{
|
||||
if (string.IsNullOrEmpty(input))
|
||||
{
|
||||
return input;
|
||||
}
|
||||
|
||||
var inputArray = input.ToCharArray();
|
||||
inputArray[0] = char.ToUpper(inputArray[0], CultureInfo.CurrentCulture);
|
||||
return new string(inputArray);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
namespace NonLocalizable
|
||||
{
|
||||
const wchar_t PowerToysAppFZEditor[] = L"POWERTOYS.FANCYZONESEDITOR.EXE";
|
||||
const wchar_t PowerToysWorkspacesEditor[] = L"POWERTOYS.WORKSPACESEDITOR.EXE";
|
||||
const char SplashClassName[] = "MsoSplash";
|
||||
const wchar_t CoreWindow[] = L"Windows.UI.Core.CoreWindow";
|
||||
const wchar_t SearchUI[] = L"SearchUI.exe";
|
||||
@@ -185,7 +184,7 @@ bool FancyZonesWindowUtils::IsExcludedByDefault(const HWND& hwnd, const std::wst
|
||||
return true;
|
||||
}
|
||||
|
||||
static std::vector<std::wstring> defaultExcludedApps = { NonLocalizable::PowerToysAppFZEditor, NonLocalizable::PowerToysWorkspacesEditor, NonLocalizable::CoreWindow, NonLocalizable::SearchUI };
|
||||
static std::vector<std::wstring> defaultExcludedApps = { NonLocalizable::PowerToysAppFZEditor, NonLocalizable::CoreWindow, NonLocalizable::SearchUI };
|
||||
return (check_excluded_app(hwnd, processPath, defaultExcludedApps));
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"Author": "ThiefZero",
|
||||
"Version": "0.0.1",
|
||||
"Language": "csharp",
|
||||
"Website": "https://github.com/ThiefZero",
|
||||
"Website": "https://aka.ms/PowerToys",
|
||||
"IcoPathDark": "Images\\unitconverter.dark.png",
|
||||
"IcoPathLight": "Images\\unitconverter.light.png",
|
||||
"ExecuteFileName": "Community.PowerToys.Run.Plugin.UnitConverter.dll"
|
||||
|
||||
@@ -7,16 +7,21 @@ using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
|
||||
using Community.PowerToys.Run.Plugin.VSCodeWorkspaces.Properties;
|
||||
using Community.PowerToys.Run.Plugin.VSCodeWorkspaces.RemoteMachinesHelper;
|
||||
using Community.PowerToys.Run.Plugin.VSCodeWorkspaces.VSCodeHelper;
|
||||
using Community.PowerToys.Run.Plugin.VSCodeWorkspaces.WorkspacesHelper;
|
||||
|
||||
using Wox.Infrastructure;
|
||||
using Wox.Plugin;
|
||||
using Wox.Plugin.Logger;
|
||||
|
||||
namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces
|
||||
{
|
||||
public class Main : IPlugin, IPluginI18n
|
||||
public class Main : IPlugin, IPluginI18n, IContextMenu
|
||||
{
|
||||
private PluginInitContext _context;
|
||||
|
||||
@@ -76,11 +81,9 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces
|
||||
|
||||
hide = true;
|
||||
}
|
||||
catch (Win32Exception)
|
||||
catch (Win32Exception ex)
|
||||
{
|
||||
var name = $"Plugin: {_context.CurrentPluginMetadata.Name}";
|
||||
var msg = "Can't Open this file";
|
||||
_context.API.ShowMsg(name, msg, string.Empty);
|
||||
HandleError("Can't Open this file", ex, showMsg: true);
|
||||
hide = false;
|
||||
}
|
||||
|
||||
@@ -124,11 +127,9 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces
|
||||
|
||||
hide = true;
|
||||
}
|
||||
catch (Win32Exception)
|
||||
catch (Win32Exception ex)
|
||||
{
|
||||
var name = $"Plugin: {_context.CurrentPluginMetadata.Name}";
|
||||
var msg = "Can't Open this file";
|
||||
_context.API.ShowMsg(name, msg, string.Empty);
|
||||
HandleError("Can't Open this file", ex, showMsg: true);
|
||||
hide = false;
|
||||
}
|
||||
|
||||
@@ -142,23 +143,23 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces
|
||||
results = results.Where(a => a.Title.Contains(query.Search, StringComparison.InvariantCultureIgnoreCase)).ToList();
|
||||
|
||||
results.ForEach(x =>
|
||||
{
|
||||
if (x.Score == 0)
|
||||
{
|
||||
x.Score = 100;
|
||||
}
|
||||
{
|
||||
if (x.Score == 0)
|
||||
{
|
||||
x.Score = 100;
|
||||
}
|
||||
|
||||
// intersect the title with the query
|
||||
var intersection = Convert.ToInt32(x.Title.ToLowerInvariant().Intersect(query.Search.ToLowerInvariant()).Count() * query.Search.Length);
|
||||
var differenceWithQuery = Convert.ToInt32((x.Title.Length - intersection) * query.Search.Length * 0.7);
|
||||
x.Score = x.Score - differenceWithQuery + intersection;
|
||||
// intersect the title with the query
|
||||
var intersection = Convert.ToInt32(x.Title.ToLowerInvariant().Intersect(query.Search.ToLowerInvariant()).Count() * query.Search.Length);
|
||||
var differenceWithQuery = Convert.ToInt32((x.Title.Length - intersection) * query.Search.Length * 0.7);
|
||||
x.Score = x.Score - differenceWithQuery + intersection;
|
||||
|
||||
// if is a remote machine give it 12 extra points
|
||||
if (x.ContextData is VSCodeRemoteMachine)
|
||||
{
|
||||
x.Score = Convert.ToInt32(x.Score + (intersection * 2));
|
||||
}
|
||||
});
|
||||
// if is a remote machine give it 12 extra points
|
||||
if (x.ContextData is VSCodeRemoteMachine)
|
||||
{
|
||||
x.Score = Convert.ToInt32(x.Score + (intersection * 2));
|
||||
}
|
||||
});
|
||||
|
||||
results = results.OrderByDescending(x => x.Score).ToList();
|
||||
if (query.Search == string.Empty || query.Search.Replace(" ", string.Empty) == string.Empty)
|
||||
@@ -174,6 +175,108 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces
|
||||
_context = context;
|
||||
}
|
||||
|
||||
public List<ContextMenuResult> LoadContextMenus(Result selectedResult)
|
||||
{
|
||||
if (selectedResult?.ContextData is not VSCodeWorkspace workspace)
|
||||
{
|
||||
return new List<ContextMenuResult>();
|
||||
}
|
||||
|
||||
string realPath = SystemPath.RealPath(workspace.RelativePath);
|
||||
|
||||
return new List<ContextMenuResult>
|
||||
{
|
||||
new ContextMenuResult
|
||||
{
|
||||
PluginName = Name,
|
||||
Title = $"{Resources.CopyPath} (Ctrl+C)",
|
||||
Glyph = "\xE8C8", // Copy
|
||||
FontFamily = "Segoe Fluent Icons,Segoe MDL2 Assets",
|
||||
AcceleratorKey = Key.C,
|
||||
AcceleratorModifiers = ModifierKeys.Control,
|
||||
Action = context => CopyToClipboard(realPath),
|
||||
},
|
||||
new ContextMenuResult
|
||||
{
|
||||
PluginName = Name,
|
||||
Title = $"{Resources.OpenInExplorer} (Ctrl+Shift+F)",
|
||||
Glyph = "\xEC50", // File Explorer
|
||||
FontFamily = "Segoe Fluent Icons,Segoe MDL2 Assets",
|
||||
AcceleratorKey = Key.F,
|
||||
AcceleratorModifiers = ModifierKeys.Control | ModifierKeys.Shift,
|
||||
Action = context => OpenInExplorer(realPath),
|
||||
},
|
||||
new ContextMenuResult
|
||||
{
|
||||
PluginName = Name,
|
||||
Title = $"{Resources.OpenInConsole} (Ctrl+Shift+C)",
|
||||
Glyph = "\xE756", // Command Prompt
|
||||
FontFamily = "Segoe Fluent Icons,Segoe MDL2 Assets",
|
||||
AcceleratorKey = Key.C,
|
||||
AcceleratorModifiers = ModifierKeys.Control | ModifierKeys.Shift,
|
||||
Action = context => OpenInConsole(realPath),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
private bool CopyToClipboard(string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
Clipboard.SetText(path);
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleError("Can't copy to clipboard", ex, showMsg: true);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private bool OpenInConsole(string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
Helper.OpenInConsole(path);
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleError($"Unable to open the specified path in the console: {path}", ex, showMsg: true);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private bool OpenInExplorer(string path)
|
||||
{
|
||||
if (!Helper.OpenInShell("explorer.exe", $"\"{path}\""))
|
||||
{
|
||||
HandleError($"Failed to open folder in Explorer at path: {path}", showMsg: true);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void HandleError(string msg, Exception exception = null, bool showMsg = false)
|
||||
{
|
||||
if (exception != null)
|
||||
{
|
||||
Log.Exception(msg, exception, exception.GetType());
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Error(msg, typeof(VSCodeWorkspaces.Main));
|
||||
}
|
||||
|
||||
if (showMsg)
|
||||
{
|
||||
_context.API.ShowMsg(
|
||||
$"Plugin: {_context.CurrentPluginMetadata.Name}",
|
||||
msg);
|
||||
}
|
||||
}
|
||||
|
||||
public string GetTranslatedPluginTitle()
|
||||
{
|
||||
return Resources.PluginTitle;
|
||||
|
||||
@@ -140,5 +140,32 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.Properties {
|
||||
return ResourceManager.GetString("Workspace", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Copy Path.
|
||||
/// </summary>
|
||||
internal static string CopyPath {
|
||||
get {
|
||||
return ResourceManager.GetString("CopyPath", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Open in console.
|
||||
/// </summary>
|
||||
internal static string OpenInConsole {
|
||||
get {
|
||||
return ResourceManager.GetString("OpenInConsole", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Open in Explorer.
|
||||
/// </summary>
|
||||
internal static string OpenInExplorer {
|
||||
get {
|
||||
return ResourceManager.GetString("OpenInExplorer", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,4 +151,13 @@
|
||||
<value>Project Folder</value>
|
||||
<comment>It refers to the Visual Studio Code Project Folders</comment>
|
||||
</data>
|
||||
<data name="CopyPath" xml:space="preserve">
|
||||
<value>Copy path</value>
|
||||
</data>
|
||||
<data name="OpenInConsole" xml:space="preserve">
|
||||
<value>Open in console</value>
|
||||
</data>
|
||||
<data name="OpenInExplorer" xml:space="preserve">
|
||||
<value>Open in Explorer</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -4,9 +4,9 @@
|
||||
"ActionKeyword": "{",
|
||||
"Name": "VS Code Workspaces",
|
||||
"Author": "ricardosantos9521",
|
||||
"Version": "1.1.0",
|
||||
"Version": "1.2.0",
|
||||
"Language": "csharp",
|
||||
"Website": "https://github.com/ricardosantos9521/PowerToys/",
|
||||
"Website": "https://aka.ms/PowerToys",
|
||||
"ExecuteFileName": "Community.PowerToys.Run.Plugin.VSCodeWorkspaces.dll",
|
||||
"IsGlobal": false,
|
||||
"IcoPathDark": "Images\\code.dark.png",
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"Author": "IHorvalds",
|
||||
"Version": "1.0.0",
|
||||
"Language": "csharp",
|
||||
"Website": "https://github/com/IHorvalds",
|
||||
"Website": "https://aka.ms/PowerToys",
|
||||
"IcoPathDark": "Images\\ValueGenerator.dark.png",
|
||||
"IcoPathLight": "Images\\ValueGenerator.light.png",
|
||||
"ExecuteFileName": "Community.PowerToys.Run.Plugin.ValueGenerator.dll"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"Author": "cyberrex5",
|
||||
"Version": "1.0.0",
|
||||
"Language": "csharp",
|
||||
"Website": "https://aka.ms/powertoys",
|
||||
"Website": "https://aka.ms/PowerToys",
|
||||
"ExecuteFileName": "Community.PowerToys.Run.Plugin.WebSearch.dll",
|
||||
"IcoPathDark": "Images\\WebSearch.dark.png",
|
||||
"IcoPathLight": "Images\\WebSearch.light.png"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"Author": "qianlifeng",
|
||||
"Version": "1.0.0",
|
||||
"Language": "csharp",
|
||||
"Website": "https://aka.ms/powertoys",
|
||||
"Website": "https://aka.ms/PowerToys",
|
||||
"ExecuteFileName": "Microsoft.Plugin.Folder.dll",
|
||||
"IcoPathDark": "Images\\folder.dark.png",
|
||||
"IcoPathLight": "Images\\folder.light.png"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"Author": "qianlifeng",
|
||||
"Version": "1.0.0",
|
||||
"Language": "csharp",
|
||||
"Website": "https://aka.ms/powertoys",
|
||||
"Website": "https://aka.ms/PowerToys",
|
||||
"ExecuteFileName": "Microsoft.Plugin.Shell.dll",
|
||||
"IcoPathDark": "Images\\shell.dark.png",
|
||||
"IcoPathLight": "Images\\shell.light.png"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"Author": "Microsoft",
|
||||
"Version": "1.0.0",
|
||||
"Language": "csharp",
|
||||
"Website": "http://aka.ms/PowerToys",
|
||||
"Website": "https://aka.ms/PowerToys",
|
||||
"ExecuteFileName": "Microsoft.Plugin.Uri.dll",
|
||||
"IcoPathDark": "Images\\uri.dark.png",
|
||||
"IcoPathLight": "Images\\uri.light.png"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"Author": "betadele",
|
||||
"Version": "1.0.0",
|
||||
"Language": "csharp",
|
||||
"Website": "https://www.windowwalker.com/",
|
||||
"Website": "https://aka.ms/PowerToys",
|
||||
"ExecuteFileName": "Microsoft.Plugin.WindowWalker.dll",
|
||||
"IcoPathDark": "Images\\windowwalker.dark.png",
|
||||
"IcoPathLight": "Images\\windowwalker.light.png"
|
||||
|
||||
@@ -192,6 +192,13 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator.UnitTests
|
||||
[DataRow("cos", false)]
|
||||
[DataRow("abs", false)]
|
||||
[DataRow("1+1.1e3", true)]
|
||||
[DataRow("randi(8)", true)]
|
||||
[DataRow("randi()", false)]
|
||||
[DataRow("randi(0.5)", true)]
|
||||
[DataRow("rand()", true)]
|
||||
[DataRow("rand(0.5)", false)]
|
||||
[DataRow("0X78AD+0o123", true)]
|
||||
[DataRow("0o9", false)]
|
||||
public void InputValid_TestValid_WhenCalled(string input, bool valid)
|
||||
{
|
||||
// Act
|
||||
@@ -228,7 +235,8 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator.UnitTests
|
||||
new object[] { "abs(-2)", 2M },
|
||||
new object[] { "abs(2)", 2M },
|
||||
new object[] { "0+(1*2)/(0+1)", 2M }, // Validate that division by "(0+1)" is not interpret as division by zero.
|
||||
new object[] { "0+(1*2)/0.5", 4M }, // Validate that division by number with decimal digits is not interpret as division by zero.
|
||||
new object[] { "0+(1*2)/0.5", 4M }, // Validate that division by number with decimal digits is not interpret as division by zero.
|
||||
new object[] { "0+(1*2)/0o004", 0.5M }, // Validate that division by an octal number with zeroes is not treated as division by zero.
|
||||
};
|
||||
|
||||
[DataTestMethod]
|
||||
|
||||
@@ -41,6 +41,8 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator.UnitTests
|
||||
[DataRow("=5 / 0", "Expression contains division by zero")]
|
||||
[DataRow("10+(8*9)/0+7", "Expression contains division by zero")]
|
||||
[DataRow("10+(8*9)/0*7", "Expression contains division by zero")]
|
||||
[DataRow("10+(8*9)/0x00", "Expression contains division by zero")]
|
||||
[DataRow("10+(8*9)/0b0", "Expression contains division by zero")]
|
||||
public void ErrorResultOnInvalidKeywordQuery(string typedString, string expectedResult)
|
||||
{
|
||||
Query expectedQuery = new(typedString, "=");
|
||||
@@ -230,6 +232,7 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator.UnitTests
|
||||
public void RightAnswerForHumanMultiplicationExpressions(string typedString, double answer)
|
||||
{
|
||||
// Setup
|
||||
typedString = typedString.Replace(".", CultureInfo.CurrentCulture.NumberFormat.CurrencyDecimalSeparator); // Workaround to get correct results when the tests are running on a non-english systems.
|
||||
Query expectedQuery = new(typedString);
|
||||
Query expectedQueryWithKeyword = new("=" + typedString, "=");
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator
|
||||
}
|
||||
|
||||
// check for division by zero
|
||||
// We check if the string contains a slash followed by space (optional) and zero. Whereas the zero must not followed by dot or comma as this indicates a number with decimal digits. The zero must also not be followed by other digits.
|
||||
if (new Regex("\\/\\s*0(?![,\\.0-9])").Match(input).Success)
|
||||
// We check if the string contains a slash followed by space (optional) and zero. Whereas the zero must not be followed by a dot, comma, 'b', 'o' or 'x' as these indicate a number with decimal digits or a binary/octal/hexadecimal value respectively. The zero must also not be followed by other digits.
|
||||
if (new Regex("\\/\\s*0(?!(?:[,\\.0-9]|[box]0*[1-9a-f]))", RegexOptions.IgnoreCase).Match(input).Success)
|
||||
{
|
||||
error = Properties.Resources.wox_plugin_calculator_division_by_zero;
|
||||
return default;
|
||||
|
||||
@@ -15,13 +15,13 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator
|
||||
@"^(" +
|
||||
@"%|" +
|
||||
@"ceil\s*\(|floor\s*\(|exp\s*\(|max\s*\(|min\s*\(|abs\s*\(|log(?:2|10)?\s*\(|ln\s*\(|sqrt\s*\(|pow\s*\(|" +
|
||||
@"factorial\s*\(|sign\s*\(|round\s*\(|rand\s*\(|" +
|
||||
@"factorial\s*\(|sign\s*\(|round\s*\(|rand\s*\(\)|randi\s*\([^\)]|" +
|
||||
@"sin\s*\(|cos\s*\(|tan\s*\(|arcsin\s*\(|arccos\s*\(|arctan\s*\(|" +
|
||||
@"sinh\s*\(|cosh\s*\(|tanh\s*\(|arsinh\s*\(|arcosh\s*\(|artanh\s*\(|" +
|
||||
@"pi|" +
|
||||
@"==|~=|&&|\|\||" +
|
||||
@"((-?(\d+(\.\d*)?)|-?(\.\d+))[Ee](-?\d+))|" + /* expression from CheckScientificNotation between parenthesis */
|
||||
@"e|[0-9]|0x[0-9a-fA-F]+|0b[01]+|[\+\-\*\/\^\., ""]|[\(\)\|\!\[\]]" +
|
||||
@"e|[0-9]|0[xX][0-9a-fA-F]+|0[bB][01]+|0[oO][0-7]+|[\+\-\*\/\^\., ""]|[\(\)\|\!\[\]]" +
|
||||
@")+$",
|
||||
RegexOptions.Compiled);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"Author": "cxfksword",
|
||||
"Version": "1.0.0",
|
||||
"Language": "csharp",
|
||||
"Website": "https://aka.ms/powertoys",
|
||||
"Website": "https://aka.ms/PowerToys",
|
||||
"ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.Calculator.dll",
|
||||
"IcoPathDark": "Images\\calculator.dark.png",
|
||||
"IcoPathLight": "Images\\calculator.light.png"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"Author": "jefflord",
|
||||
"Version": "1.0.0",
|
||||
"Language": "csharp",
|
||||
"Website": "https://aka.ms/powertoys",
|
||||
"Website": "https://aka.ms/PowerToys",
|
||||
"ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.History.dll",
|
||||
"IcoPathDark": "Images\\history.dark.png",
|
||||
"IcoPathLight": "Images\\history.light.png"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"Author": "palenshus",
|
||||
"Version": "1.0.0",
|
||||
"Language": "csharp",
|
||||
"Website": "https://aka.ms/powertoys",
|
||||
"Website": "https://aka.ms/PowerToys",
|
||||
"ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.OneNote.dll",
|
||||
"IcoPathDark": "Images\\oneNote.dark.png",
|
||||
"IcoPathLight": "Images\\oneNote.light.png"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"Author": "davidegiacometti",
|
||||
"Version": "1.0.0",
|
||||
"Language": "csharp",
|
||||
"Website": "https://aka.ms/powertoys",
|
||||
"Website": "https://aka.ms/PowerToys",
|
||||
"ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.PowerToys.dll",
|
||||
"IcoPathDark": "Images\\PowerToys.dark.png",
|
||||
"IcoPathLight": "Images\\PowerToys.light.png"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"Author": "TobiasSekan",
|
||||
"Version": "1.0.0",
|
||||
"Language": "csharp",
|
||||
"Website": "https://aka.ms/powertoys",
|
||||
"Website": "https://aka.ms/PowerToys",
|
||||
"ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.Registry.dll",
|
||||
"IcoPathDark": "Images\\reg.dark.png",
|
||||
"IcoPathLight": "Images\\reg.light.png"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"Author": "davidegiacometti",
|
||||
"Version": "1.0.0",
|
||||
"Language": "csharp",
|
||||
"Website": "https://aka.ms/powertoys",
|
||||
"Website": "https://aka.ms/PowerToys",
|
||||
"ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.Service.dll",
|
||||
"IcoPathDark": "Images\\service.dark.png",
|
||||
"IcoPathLight": "Images\\service.light.png"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"Author": "Wox",
|
||||
"Version": "1.0.0",
|
||||
"Language": "csharp",
|
||||
"Website": "https://aka.ms/powertoys",
|
||||
"Website": "https://aka.ms/PowerToys",
|
||||
"ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.System.dll",
|
||||
"IcoPathDark": "Images\\lock.dark.png",
|
||||
"IcoPathLight": "Images\\lock.light.png"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"Author": "htcfreek",
|
||||
"Version": "1.0.0",
|
||||
"Language": "csharp",
|
||||
"Website": "https://aka.ms/powertoys",
|
||||
"Website": "https://aka.ms/PowerToys",
|
||||
"ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.TimeDate.dll",
|
||||
"IcoPathDark": "Images\\timeDate.dark.png",
|
||||
"IcoPathLight": "Images\\timeDate.light.png"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"Author": "TobiasSekan",
|
||||
"Version": "1.0.0",
|
||||
"Language": "csharp",
|
||||
"Website": "https://aka.ms/powertoys",
|
||||
"Website": "https://aka.ms/PowerToys",
|
||||
"ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.WindowsSettings.dll",
|
||||
"IcoPathDark": "Images\\WindowsSettings.dark.png",
|
||||
"IcoPathLight": "Images\\WindowsSettings.light.png"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"Author": "davidegiacometti",
|
||||
"Version": "1.0.0",
|
||||
"Language": "csharp",
|
||||
"Website": "https://aka.ms/powertoys",
|
||||
"Website": "https://aka.ms/PowerToys",
|
||||
"ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.WindowsTerminal.dll",
|
||||
"IcoPathDark": "Images\\WindowsTerminal.dark.png",
|
||||
"IcoPathLight": "Images\\WindowsTerminal.light.png"
|
||||
|
||||
@@ -37,7 +37,8 @@
|
||||
<Border
|
||||
x:Name="SearchBoxBorder"
|
||||
Grid.Row="0"
|
||||
Padding="12,4,12,3">
|
||||
Padding="12,4,12,3"
|
||||
Background="Transparent">
|
||||
<local:LauncherControl x:Name="SearchBox" />
|
||||
</Border>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.IO.Abstractions;
|
||||
using System.Linq;
|
||||
@@ -251,7 +252,9 @@ namespace PowerLauncher
|
||||
Id = x.Metadata.ID,
|
||||
Name = x.Plugin == null ? x.Metadata.Name : x.Plugin.Name,
|
||||
Description = x.Plugin?.Description,
|
||||
Version = FileVersionInfo.GetVersionInfo(x.Metadata.ExecuteFilePath).FileVersion,
|
||||
Author = x.Metadata.Author,
|
||||
Website = x.Metadata.Website,
|
||||
Disabled = x.Metadata.Disabled,
|
||||
IsGlobal = x.Metadata.IsGlobal,
|
||||
ActionKeyword = x.Metadata.ActionKeyword,
|
||||
@@ -281,7 +284,9 @@ namespace PowerLauncher
|
||||
var enabledPolicyState = GPOWrapper.GetRunPluginEnabledValue(id);
|
||||
plugin.Name = name;
|
||||
plugin.Description = value.Description;
|
||||
plugin.Version = value.Version;
|
||||
plugin.Author = value.Author;
|
||||
plugin.Website = value.Website;
|
||||
plugin.IconPathDark = value.IconPathDark;
|
||||
plugin.IconPathLight = value.IconPathLight;
|
||||
plugin.EnabledPolicyUiState = (int)enabledPolicyState;
|
||||
|
||||
@@ -39,6 +39,7 @@ namespace PowerAccent.Core
|
||||
NL,
|
||||
NO,
|
||||
PI,
|
||||
PIE,
|
||||
PL,
|
||||
PT,
|
||||
RO,
|
||||
@@ -100,6 +101,7 @@ namespace PowerAccent.Core
|
||||
Language.NL => GetDefaultLetterKeyNL(letter), // Dutch
|
||||
Language.NO => GetDefaultLetterKeyNO(letter), // Norwegian
|
||||
Language.PI => GetDefaultLetterKeyPI(letter), // Pinyin
|
||||
Language.PIE => GetDefaultLetterKeyPIE(letter), // Proto-Indo-European
|
||||
Language.PL => GetDefaultLetterKeyPL(letter), // Polish
|
||||
Language.PT => GetDefaultLetterKeyPT(letter), // Portuguese
|
||||
Language.RO => GetDefaultLetterKeyRO(letter), // Romanian
|
||||
@@ -155,6 +157,7 @@ namespace PowerAccent.Core
|
||||
.Union(GetDefaultLetterKeyNL(letter))
|
||||
.Union(GetDefaultLetterKeyNO(letter))
|
||||
.Union(GetDefaultLetterKeyPI(letter))
|
||||
.Union(GetDefaultLetterKeyPIE(letter))
|
||||
.Union(GetDefaultLetterKeyPL(letter))
|
||||
.Union(GetDefaultLetterKeyPT(letter))
|
||||
.Union(GetDefaultLetterKeyRO(letter))
|
||||
@@ -463,6 +466,24 @@ namespace PowerAccent.Core
|
||||
};
|
||||
}
|
||||
|
||||
// Proto-Indo-European
|
||||
private static string[] GetDefaultLetterKeyPIE(LetterKey letter)
|
||||
{
|
||||
return letter switch
|
||||
{
|
||||
LetterKey.VK_A => new[] { "ā" },
|
||||
LetterKey.VK_E => new[] { "ē" },
|
||||
LetterKey.VK_O => new[] { "ō" },
|
||||
LetterKey.VK_K => new[] { "ḱ" },
|
||||
LetterKey.VK_G => new[] { "ǵ" },
|
||||
LetterKey.VK_R => new[] { "r̥" },
|
||||
LetterKey.VK_L => new[] { "l̥" },
|
||||
LetterKey.VK_M => new[] { "m̥" },
|
||||
LetterKey.VK_N => new[] { "n̥" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
|
||||
// Turkish
|
||||
private static string[] GetDefaultLetterKeyTK(LetterKey letter)
|
||||
{
|
||||
@@ -860,7 +881,7 @@ namespace PowerAccent.Core
|
||||
{
|
||||
return letter switch
|
||||
{
|
||||
LetterKey.VK_C => new[] { "č" },
|
||||
LetterKey.VK_C => new[] { "č", "ć" },
|
||||
LetterKey.VK_E => new[] { "€" },
|
||||
LetterKey.VK_S => new[] { "š" },
|
||||
LetterKey.VK_Z => new[] { "ž" },
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<!-- Look at Directory.Build.props in root for common stuff as well -->
|
||||
<Import Project="..\..\..\Common.Dotnet.CsWinRT.props" />
|
||||
<Import Project="..\..\..\Common.SelfContained.props" />
|
||||
<Import Project="..\..\..\Common.Dotnet.AotCompatibility.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Microsoft.PowerToys.PreviewHandler.Markdown
|
||||
/// <summary>
|
||||
/// Win Form Implementation for Markdown Preview Handler.
|
||||
/// </summary>
|
||||
public class MarkdownPreviewHandlerControl : FormHandlerControl
|
||||
public partial class MarkdownPreviewHandlerControl : FormHandlerControl
|
||||
{
|
||||
private static readonly IFileSystem FileSystem = new FileSystem();
|
||||
private static readonly IPath Path = FileSystem.Path;
|
||||
@@ -66,7 +66,7 @@ namespace Microsoft.PowerToys.PreviewHandler.Markdown
|
||||
{
|
||||
get
|
||||
{
|
||||
string codeBase = Assembly.GetExecutingAssembly().Location;
|
||||
string codeBase = AppContext.BaseDirectory;
|
||||
UriBuilder uri = new UriBuilder(codeBase);
|
||||
string path = Uri.UnescapeDataString(uri.Path);
|
||||
return Path.GetDirectoryName(path);
|
||||
|
||||
@@ -14,8 +14,12 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
||||
|
||||
public string Description { get; set; }
|
||||
|
||||
public string Version { get; set; }
|
||||
|
||||
public string Author { get; set; }
|
||||
|
||||
public string Website { get; set; }
|
||||
|
||||
public bool Disabled { get; set; }
|
||||
|
||||
// Use to communicate the state to settings UI (Using int type because we can't reference GPOWrapper.)
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
"*settings.json",
|
||||
"*FancyZones\\custom-layouts.json",
|
||||
"*FancyZones\\layout-hotkeys.json",
|
||||
"*FancyZones\\layout-templates.json"
|
||||
"*FancyZones\\layout-templates.json",
|
||||
"*Workspaces\\workspaces.json"
|
||||
],
|
||||
"IgnoreFiles": [
|
||||
"*PowerToys\\log_settings.json",
|
||||
|
||||
@@ -19,6 +19,11 @@
|
||||
<Setter Property="Foreground" Value="{ThemeResource TextFillColorSecondaryBrush}" />
|
||||
</Style>
|
||||
|
||||
<x:Double x:Key="SecondaryLinkFontSize">12</x:Double>
|
||||
<Style x:Key="SecondaryLinkTextStyle" TargetType="TextBlock">
|
||||
<Setter Property="FontSize" Value="{StaticResource SecondaryTextFontSize}" />
|
||||
</Style>
|
||||
|
||||
<x:Double x:Key="HeaderTextFontSize">12</x:Double>
|
||||
<Style x:Key="HeaderTextStyle" TargetType="TextBlock">
|
||||
<Setter Property="FontSize" Value="{StaticResource HeaderTextFontSize}" />
|
||||
|
||||
@@ -281,60 +281,62 @@
|
||||
IsPrimaryButtonEnabled="False"
|
||||
IsSecondaryButtonEnabled="True"
|
||||
PrimaryButtonStyle="{StaticResource AccentButtonStyle}">
|
||||
<Grid RowSpacing="24">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Image Margin="-24,-24,-24,0" Source="{ThemeResource DialogHeaderImage}" />
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||
TextWrapping="Wrap">
|
||||
<Run x:Uid="AdvancedPaste_EnableAIDialog_Description" />
|
||||
<Hyperlink NavigateUri="https://openai.com/policies/terms-of-use" TabIndex="3">
|
||||
<Run x:Uid="TermsLink" />
|
||||
</Hyperlink>
|
||||
<Run x:Uid="AIFooterSeparator" Foreground="{ThemeResource TextFillColorSecondaryBrush}">|</Run>
|
||||
<Hyperlink NavigateUri="https://openai.com/policies/privacy-policy" TabIndex="3">
|
||||
<Run x:Uid="PrivacyLink" />
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
|
||||
<StackPanel Grid.Row="2" Orientation="Vertical">
|
||||
<TextBlock x:Uid="AdvancedPaste_EnableAIDialog_ConfigureOpenAIKey" FontWeight="SemiBold" />
|
||||
<TextBlock Grid.Row="2" TextWrapping="Wrap">
|
||||
<Run x:Uid="AdvancedPaste_EnableAIDialog_LoginIntoText" />
|
||||
<Hyperlink NavigateUri="https://platform.openai.com/api-keys">
|
||||
<Run x:Uid="AdvancedPaste_EnableAIDialog_OpenAIApiKeysOverviewText" />
|
||||
</Hyperlink>
|
||||
<LineBreak />
|
||||
<Run x:Uid="AdvancedPaste_EnableAIDialog_CreateNewKeyText" />
|
||||
<LineBreak />
|
||||
<Run x:Uid="AdvancedPaste_EnableAIDialog_NoteAICreditsText" />
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
<Grid Grid.Row="3" ColumnSpacing="8">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<Grid RowSpacing="24">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Image Margin="-24,-24,-24,0" Source="{ThemeResource DialogHeaderImage}" />
|
||||
<TextBlock
|
||||
x:Uid="AdvancedPaste_EnableAIDialogOpenAIApiKey"
|
||||
VerticalAlignment="Center"
|
||||
TextWrapping="Wrap" />
|
||||
<TextBox
|
||||
x:Name="AdvancedPaste_EnableAIDialogOpenAIApiKey"
|
||||
Grid.Column="1"
|
||||
MinWidth="248"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
TextChanged="AdvancedPaste_EnableAIDialogOpenAIApiKey_TextChanged" />
|
||||
Grid.Row="1"
|
||||
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||
TextWrapping="Wrap">
|
||||
<Run x:Uid="AdvancedPaste_EnableAIDialog_Description" />
|
||||
<Hyperlink NavigateUri="https://openai.com/policies/terms-of-use" TabIndex="3">
|
||||
<Run x:Uid="TermsLink" />
|
||||
</Hyperlink>
|
||||
<Run x:Uid="AIFooterSeparator" Foreground="{ThemeResource TextFillColorSecondaryBrush}">|</Run>
|
||||
<Hyperlink NavigateUri="https://openai.com/policies/privacy-policy" TabIndex="3">
|
||||
<Run x:Uid="PrivacyLink" />
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
|
||||
<StackPanel Grid.Row="2" Orientation="Vertical">
|
||||
<TextBlock x:Uid="AdvancedPaste_EnableAIDialog_ConfigureOpenAIKey" FontWeight="SemiBold" />
|
||||
<TextBlock Grid.Row="2" TextWrapping="Wrap">
|
||||
<Run x:Uid="AdvancedPaste_EnableAIDialog_LoginIntoText" />
|
||||
<Hyperlink NavigateUri="https://platform.openai.com/api-keys">
|
||||
<Run x:Uid="AdvancedPaste_EnableAIDialog_OpenAIApiKeysOverviewText" />
|
||||
</Hyperlink>
|
||||
<LineBreak />
|
||||
<Run x:Uid="AdvancedPaste_EnableAIDialog_CreateNewKeyText" />
|
||||
<LineBreak />
|
||||
<Run x:Uid="AdvancedPaste_EnableAIDialog_NoteAICreditsText" />
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
<Grid Grid.Row="3" ColumnSpacing="8">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
x:Uid="AdvancedPaste_EnableAIDialogOpenAIApiKey"
|
||||
VerticalAlignment="Center"
|
||||
TextWrapping="Wrap" />
|
||||
<TextBox
|
||||
x:Name="AdvancedPaste_EnableAIDialogOpenAIApiKey"
|
||||
Grid.Column="1"
|
||||
MinWidth="248"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
TextChanged="AdvancedPaste_EnableAIDialogOpenAIApiKey_TextChanged" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</ContentDialog>
|
||||
<ContentDialog
|
||||
x:Name="CustomActionDialog"
|
||||
|
||||
@@ -687,11 +687,46 @@
|
||||
<tkcontrols:SettingsCard
|
||||
MinHeight="0"
|
||||
BorderThickness="0"
|
||||
ContentAlignment="Right">
|
||||
<TextBlock Opacity="{x:Bind DisabledOpacity}" Style="{ThemeResource SecondaryTextStyle}">
|
||||
<Run x:Uid="PowerLauncher_AuthoredBy" />
|
||||
<Run FontWeight="SemiBold" Text="{x:Bind Author}" />
|
||||
</TextBlock>
|
||||
ContentAlignment="Right"
|
||||
IsEnabled="{x:Bind Enabled, Mode=OneWay}">
|
||||
<StackPanel
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal"
|
||||
Spacing="4">
|
||||
<TextBlock Opacity="{x:Bind DisabledOpacity}" Style="{ThemeResource SecondaryTextStyle}">
|
||||
<Run x:Uid="PowerLauncher_PluginVersion" />
|
||||
<Run FontWeight="SemiBold" Text="{x:Bind Version}" />
|
||||
</TextBlock>
|
||||
<TextBlock
|
||||
AutomationProperties.Name=","
|
||||
IsTabStop="False"
|
||||
Opacity="{x:Bind DisabledOpacity}"
|
||||
Style="{ThemeResource SecondaryTextStyle}"
|
||||
Text="|" />
|
||||
<TextBlock Opacity="{x:Bind DisabledOpacity}" Style="{ThemeResource SecondaryTextStyle}">
|
||||
<Run x:Uid="PowerLauncher_AuthoredBy" />
|
||||
<Run FontWeight="SemiBold" Text="{x:Bind Author}" />
|
||||
</TextBlock>
|
||||
<TextBlock
|
||||
AutomationProperties.Name=","
|
||||
IsTabStop="False"
|
||||
Opacity="{x:Bind DisabledOpacity}"
|
||||
Style="{ThemeResource SecondaryTextStyle}"
|
||||
Text="|"
|
||||
Visibility="{x:Bind HasValidWebsiteUri, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}" />
|
||||
<HyperlinkButton
|
||||
Margin="0"
|
||||
Padding="0"
|
||||
NavigateUri="{x:Bind WebsiteUri}"
|
||||
Opacity="{x:Bind DisabledOpacity}"
|
||||
Style="{StaticResource TextButtonStyle}"
|
||||
Visibility="{x:Bind HasValidWebsiteUri, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}">
|
||||
<TextBlock
|
||||
x:Uid="PowerLauncher_PluginWebsite"
|
||||
FontWeight="SemiBold"
|
||||
Style="{ThemeResource SecondaryLinkTextStyle}" />
|
||||
</HyperlinkButton>
|
||||
</StackPanel>
|
||||
</tkcontrols:SettingsCard>
|
||||
</tkcontrols:SettingsExpander.Items>
|
||||
</tkcontrols:SettingsExpander>
|
||||
|
||||
@@ -3580,10 +3580,10 @@ Activate by holding the key for the character you want to add an accent to, then
|
||||
<value>Characters</value>
|
||||
</data>
|
||||
<data name="QuickAccent_SelectedLanguage.Header" xml:space="preserve">
|
||||
<value>Choose a character set</value>
|
||||
<value>Choose character sets</value>
|
||||
</data>
|
||||
<data name="QuickAccent_SelectedLanguage.Description" xml:space="preserve">
|
||||
<value>Show only accented characters common to the selected set</value>
|
||||
<value>Show only accented characters common to the selected sets</value>
|
||||
</data>
|
||||
<data name="QuickAccent_SelectedLanguage_All.Content" xml:space="preserve">
|
||||
<value>All available</value>
|
||||
@@ -3672,6 +3672,9 @@ Activate by holding the key for the character you want to add an accent to, then
|
||||
<data name="QuickAccent_SelectedLanguage_Pinyin" xml:space="preserve">
|
||||
<value>Pinyin</value>
|
||||
</data>
|
||||
<data name="QuickAccent_SelectedLanguage_Proto_Indo_European" xml:space="preserve">
|
||||
<value>Proto Indo European</value>
|
||||
</data>
|
||||
<data name="QuickAccent_SelectedLanguage_Polish" xml:space="preserve">
|
||||
<value>Polish</value>
|
||||
</data>
|
||||
@@ -3966,7 +3969,7 @@ Activate by holding the key for the character you want to add an accent to, then
|
||||
</data>
|
||||
<data name="AdvancedPaste_EnableAdvancedAI.Description" xml:space="preserve">
|
||||
<value>Add advanced capabilities when using 'Paste with AI' including the power to 'chain' multiple transformations together and work with images and files. This feature may consume more API credits when used.</value>
|
||||
</data>
|
||||
</data>
|
||||
<data name="Oobe_AdvancedPaste.Description" xml:space="preserve">
|
||||
<value>Advanced Paste is a tool to put your clipboard content into any format you need, focused towards developer workflows. It can paste as plain text, markdown, or json directly with the UX or with a direct keystroke invoke. These are fully locally executed. In addition, it has an AI powered option that is 100% opt-in and requires an Open AI key. Note: this will replace the formatted text in your clipboard with the selected format.</value>
|
||||
</data>
|
||||
@@ -4695,4 +4698,10 @@ Activate by holding the key for the character you want to add an accent to, then
|
||||
<data name="Enable_Module.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>Enable module</value>
|
||||
</data>
|
||||
<data name="PowerLauncher_PluginVersion.Text" xml:space="preserve">
|
||||
<value>Version</value>
|
||||
</data>
|
||||
<data name="PowerLauncher_PluginWebsite.Text" xml:space="preserve">
|
||||
<value>Project website</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -55,6 +55,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
new PowerAccentLanguageModel("MI", "QuickAccent_SelectedLanguage_Maori", LanguageGroup),
|
||||
new PowerAccentLanguageModel("NO", "QuickAccent_SelectedLanguage_Norwegian", LanguageGroup),
|
||||
new PowerAccentLanguageModel("PI", "QuickAccent_SelectedLanguage_Pinyin", LanguageGroup),
|
||||
new PowerAccentLanguageModel("PIE", "QuickAccent_SelectedLanguage_Proto_Indo_European", LanguageGroup),
|
||||
new PowerAccentLanguageModel("PL", "QuickAccent_SelectedLanguage_Polish", LanguageGroup),
|
||||
new PowerAccentLanguageModel("PT", "QuickAccent_SelectedLanguage_Portuguese", LanguageGroup),
|
||||
new PowerAccentLanguageModel("RO", "QuickAccent_SelectedLanguage_Romanian", LanguageGroup),
|
||||
|
||||
@@ -38,6 +38,9 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
|
||||
_enabledGpoRuleConfiguration = (GpoRuleConfigured)settings.EnabledPolicyUiState;
|
||||
_enabledGpoRuleIsConfigured = _enabledGpoRuleConfiguration == GpoRuleConfigured.Disabled || _enabledGpoRuleConfiguration == GpoRuleConfigured.Enabled;
|
||||
|
||||
_hasValidWebsiteUri = Uri.IsWellFormedUriString(settings.Website, UriKind.Absolute);
|
||||
_websiteUri = _hasValidWebsiteUri ? settings.Website : WebsiteFallbackUri;
|
||||
}
|
||||
|
||||
public string Id { get => settings.Id; }
|
||||
@@ -46,8 +49,19 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
|
||||
public string Description { get => settings.Description; }
|
||||
|
||||
public string Version { get => settings.Version; }
|
||||
|
||||
public string Author { get => settings.Author; }
|
||||
|
||||
// Fallback value for the website in case the uri from json is not well formatted
|
||||
private const string WebsiteFallbackUri = "https://aka.ms/PowerToys";
|
||||
private string _websiteUri;
|
||||
private bool _hasValidWebsiteUri;
|
||||
|
||||
public string WebsiteUri => _websiteUri;
|
||||
|
||||
public bool HasValidWebsiteUri => _hasValidWebsiteUri;
|
||||
|
||||
private GpoRuleConfigured _enabledGpoRuleConfiguration;
|
||||
private bool _enabledGpoRuleIsConfigured;
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
_languageIndex = value;
|
||||
if (_powerOcrSettings != null && _languageIndex < possibleOcrLanguages.Count && _languageIndex >= 0)
|
||||
{
|
||||
_powerOcrSettings.Properties.PreferredLanguage = possibleOcrLanguages[_languageIndex].DisplayName;
|
||||
_powerOcrSettings.Properties.PreferredLanguage = possibleOcrLanguages[_languageIndex].NativeName;
|
||||
NotifySettingsChanged();
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
systemLanguageIndex = AvailableLanguages.Count;
|
||||
}
|
||||
|
||||
AvailableLanguages.Add(language.NativeName);
|
||||
AvailableLanguages.Add(EnsureStartUpper(language.NativeName));
|
||||
}
|
||||
|
||||
// if the previously stored preferred language is not available (has been deleted or this is the first run with language preference)
|
||||
@@ -264,5 +264,17 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
Dispose(disposing: true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
private string EnsureStartUpper(string input)
|
||||
{
|
||||
if (string.IsNullOrEmpty(input))
|
||||
{
|
||||
return input;
|
||||
}
|
||||
|
||||
var inputArray = input.ToCharArray();
|
||||
inputArray[0] = char.ToUpper(inputArray[0], CultureInfo.CurrentCulture);
|
||||
return new string(inputArray);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user