mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-11-14 22:55:52 -06:00
6d88e51462
* Add Selected Apps Label, Reshuffel the nesting of the checkbox and the label to be able to reference the name from the actual checkbox * Add visual selection and allow click on the whole app section * Fix Theme definition to work with theme change * Fix Highlight on if label or icon is clicked * change applications.json to powershell object list and refactor UI Creation logic * Optimization and Add Collapsable Categories * Add Button functionality for install, uninstall, info, install selected, uninstall selected, clear and implement search * Rest application.json to Main * Reset Compile to main * Pretty much revamp_apps but without changes to applications.json * Small fixes
55 lines
2.2 KiB
PowerShell
55 lines
2.2 KiB
PowerShell
function Invoke-WPFGetInstalled {
|
|
<#
|
|
TODO: Add the Option to use Chocolatey as Engine
|
|
.SYNOPSIS
|
|
Invokes the function that gets the checkboxes to check in a new runspace
|
|
|
|
.PARAMETER checkbox
|
|
Indicates whether to check for installed 'winget' programs or applied 'tweaks'
|
|
|
|
#>
|
|
param($checkbox)
|
|
|
|
if($sync.ProcessRunning) {
|
|
$msg = "[Invoke-WPFGetInstalled] Install process is currently running."
|
|
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
|
return
|
|
}
|
|
|
|
if(($sync.WPFpreferChocolatey.IsChecked -eq $false) -and ((Test-WinUtilPackageManager -winget) -eq "not-installed") -and $checkbox -eq "winget") {
|
|
return
|
|
}
|
|
$preferChoco = $sync.WPFpreferChocolatey.IsChecked
|
|
Invoke-WPFRunspace -ArgumentList $checkbox, $preferChoco -ParameterList @(,("ShowOnlyCheckedApps",${function:Show-OnlyCheckedApps})) -DebugPreference $DebugPreference -ScriptBlock {
|
|
param($checkbox, $preferChoco, $ShowOnlyCheckedApps,$DebugPreference)
|
|
Write-Host $ShowOnlyCheckedApps.ToString()
|
|
$sync.ProcessRunning = $true
|
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" })
|
|
|
|
if($checkbox -eq "winget") {
|
|
Write-Host "Getting Installed Programs..."
|
|
}
|
|
if($checkbox -eq "tweaks") {
|
|
Write-Host "Getting Installed Tweaks..."
|
|
}
|
|
if ($preferChoco -and $checkbox -eq "winget") {
|
|
$Checkboxes = Invoke-WinUtilCurrentSystem -CheckBox "choco"
|
|
}
|
|
else{
|
|
$Checkboxes = Invoke-WinUtilCurrentSystem -CheckBox $checkbox
|
|
}
|
|
|
|
$sync.form.Dispatcher.invoke({
|
|
foreach($checkbox in $Checkboxes) {
|
|
$sync.$checkbox.ischecked = $True
|
|
}
|
|
})
|
|
$sync.ItemsControl.Dispatcher.Invoke([action]{
|
|
$ShowOnlyCheckedApps.Invoke($sync.SelectedApps, $sync.ItemsControl)
|
|
})
|
|
Write-Host "Done..."
|
|
$sync.ProcessRunning = $false
|
|
$sync.form.Dispatcher.Invoke([action] { Set-WinUtilTaskbaritem -state "None" })
|
|
}
|
|
}
|