mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-12-25 07:21:30 -06:00
Small fixes to the Get-Installed function and formatting stuff
This commit is contained in:
parent
dcf752fdeb
commit
8d34e2fa30
@ -9,7 +9,6 @@ function Invoke-WPFGetInstalled {
|
|||||||
|
|
||||||
#>
|
#>
|
||||||
param($checkbox)
|
param($checkbox)
|
||||||
|
|
||||||
if ($sync.ProcessRunning) {
|
if ($sync.ProcessRunning) {
|
||||||
$msg = "[Invoke-WPFGetInstalled] Install process is currently running."
|
$msg = "[Invoke-WPFGetInstalled] Install process is currently running."
|
||||||
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
||||||
@ -24,22 +23,22 @@ function Invoke-WPFGetInstalled {
|
|||||||
$sync.ItemsControl.Items | ForEach-Object { $_.Visibility = [Windows.Visibility]::Collapsed }
|
$sync.ItemsControl.Items | ForEach-Object { $_.Visibility = [Windows.Visibility]::Collapsed }
|
||||||
$null = $sync.itemsControl.Items.Add($sync.LoadingLabel)
|
$null = $sync.itemsControl.Items.Add($sync.LoadingLabel)
|
||||||
})
|
})
|
||||||
Invoke-WPFRunspace -ArgumentList $checkbox, $preferChoco -ParameterList @(,("ShowOnlyCheckedApps",${function:Show-OnlyCheckedApps})) -DebugPreference $DebugPreference -ScriptBlock {
|
Invoke-WPFRunspace -ParameterList @(("preferChoco", $preferChoco),("checkbox", $checkbox),("ShowOnlyCheckedApps", ${function:Show-OnlyCheckedApps})) -DebugPreference $DebugPreference -ScriptBlock {
|
||||||
param($checkbox, $preferChoco, $ShowOnlyCheckedApps,$DebugPreference)
|
param (
|
||||||
|
[string]$checkbox,
|
||||||
|
[boolean]$preferChoco,
|
||||||
|
[scriptblock]$ShowOnlyCheckedApps
|
||||||
|
)
|
||||||
$sync.ProcessRunning = $true
|
$sync.ProcessRunning = $true
|
||||||
$sync.form.Dispatcher.Invoke([action] { Set-WinUtilTaskbaritem -state "Indeterminate" })
|
$sync.form.Dispatcher.Invoke([action] { Set-WinUtilTaskbaritem -state "Indeterminate" })
|
||||||
|
|
||||||
if ($checkbox -eq "winget") {
|
if ($checkbox -eq "winget") {
|
||||||
Write-Host "Getting Installed Programs..."
|
Write-Host "Getting Installed Programs..."
|
||||||
|
if ($preferChoco) { $Checkboxes = Invoke-WinUtilCurrentSystem -CheckBox "choco" }
|
||||||
|
else { $Checkboxes = Invoke-WinUtilCurrentSystem -CheckBox $checkbox }
|
||||||
}
|
}
|
||||||
if($checkbox -eq "tweaks") {
|
elseif ($checkbox -eq "tweaks") {
|
||||||
Write-Host "Getting Installed Tweaks..."
|
Write-Host "Getting Installed Tweaks..."
|
||||||
}
|
|
||||||
if ($preferChoco -and $checkbox -eq "winget") {
|
|
||||||
$Checkboxes = Invoke-WinUtilCurrentSystem -CheckBox "choco"
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$Checkboxes = Invoke-WinUtilCurrentSystem -CheckBox $checkbox
|
$Checkboxes = Invoke-WinUtilCurrentSystem -CheckBox $checkbox
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,6 +55,10 @@ function Show-OnlyCheckedApps {
|
|||||||
[Parameter(Mandatory=$true)]
|
[Parameter(Mandatory=$true)]
|
||||||
[System.Windows.Controls.ItemsControl]$ItemsControl
|
[System.Windows.Controls.ItemsControl]$ItemsControl
|
||||||
)
|
)
|
||||||
|
# If no apps are selected, do not allow switching to show only selected
|
||||||
|
if (($false -eq $sync.ShowOnlySelected) -and ($appKeys.Count -eq 0)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
$sync.ShowOnlySelected = -not $sync.ShowOnlySelected
|
$sync.ShowOnlySelected = -not $sync.ShowOnlySelected
|
||||||
if ($sync.ShowOnlySelected) {
|
if ($sync.ShowOnlySelected) {
|
||||||
$sync.Buttons.ShowSelectedAppsButton.Content = "Show All"
|
$sync.Buttons.ShowSelectedAppsButton.Content = "Show All"
|
||||||
|
@ -124,7 +124,6 @@ $sync.configs.applications.PSObject.Properties | ForEach-Object {
|
|||||||
Invoke-WPFUIElements -configVariable $sync.configs.appnavigation -targetGridName "appscategory" -columncount 1
|
Invoke-WPFUIElements -configVariable $sync.configs.appnavigation -targetGridName "appscategory" -columncount 1
|
||||||
Invoke-WPFUIApps -Apps $sync.configs.applicationsHashtable -targetGridName "appspanel"
|
Invoke-WPFUIApps -Apps $sync.configs.applicationsHashtable -targetGridName "appspanel"
|
||||||
|
|
||||||
|
|
||||||
Invoke-WPFUIElements -configVariable $sync.configs.tweaks -targetGridName "tweakspanel" -columncount 2
|
Invoke-WPFUIElements -configVariable $sync.configs.tweaks -targetGridName "tweakspanel" -columncount 2
|
||||||
Invoke-WPFUIElements -configVariable $sync.configs.feature -targetGridName "featurespanel" -columncount 2
|
Invoke-WPFUIElements -configVariable $sync.configs.feature -targetGridName "featurespanel" -columncount 2
|
||||||
|
|
||||||
|
@ -42,6 +42,7 @@ $sync.ProcessRunning = $false
|
|||||||
$sync.selectedApps = [System.Collections.Generic.List[string]]::new()
|
$sync.selectedApps = [System.Collections.Generic.List[string]]::new()
|
||||||
$sync.ShowOnlySeleced = $false
|
$sync.ShowOnlySeleced = $false
|
||||||
$sync.currentTab = "Install"
|
$sync.currentTab = "Install"
|
||||||
|
$sync.ShowOnlySelected = $false
|
||||||
|
|
||||||
|
|
||||||
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
|
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user