mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-06-09 15:57:27 +00:00
Remove -NoUi (#4572)
* Made -NoUi not exit the window * Update start.ps1 * Update main.ps1 * Update main.ps1 * Update Set-WinUtilProgressbar.ps1 * Update Invoke-WPFImpex.ps1 * Update Invoke-WPFUIThread.ps1 * Update start.ps1 * Update Invoke-WPFUIThread.ps1 * Update main.ps1 * Update main.ps1
This commit is contained in:
@@ -14,10 +14,6 @@ function Set-WinUtilProgressbar{
|
||||
[int]$Percent
|
||||
)
|
||||
|
||||
if($PARAM_NOUI) {
|
||||
return;
|
||||
}
|
||||
|
||||
Invoke-WPFUIThread -ScriptBlock {$sync.progressBarTextBlock.Text = $label}
|
||||
Invoke-WPFUIThread -ScriptBlock {$sync.progressBarTextBlock.ToolTip = $label}
|
||||
if ($percent -lt 5 ) {
|
||||
|
||||
@@ -92,17 +92,6 @@ function Invoke-WPFImpex {
|
||||
$sync.selectedFeatures = [System.Collections.Generic.List[string]]::new()
|
||||
|
||||
Update-WinUtilSelections -flatJson $flattenedJson
|
||||
|
||||
if (!$PARAM_NOUI) {
|
||||
# Set flag so toggle Checked/Unchecked events don't trigger registry writes
|
||||
# while we're programmatically restoring UI state from the imported config
|
||||
$sync.ImportInProgress = $true
|
||||
try {
|
||||
Reset-WPFCheckBoxes -doToggles $true
|
||||
} finally {
|
||||
$sync.ImportInProgress = $false
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
Write-Error "An error occurred while importing: $_"
|
||||
|
||||
@@ -1,21 +1,3 @@
|
||||
function Invoke-WPFUIThread {
|
||||
<#
|
||||
|
||||
.SYNOPSIS
|
||||
Creates and runs a task on Winutil's WPF Forms thread.
|
||||
|
||||
.PARAMETER ScriptBlock
|
||||
The scriptblock to invoke in the thread
|
||||
#>
|
||||
|
||||
[CmdletBinding()]
|
||||
Param (
|
||||
$ScriptBlock
|
||||
)
|
||||
|
||||
if ($PARAM_NOUI) {
|
||||
return;
|
||||
}
|
||||
|
||||
function Invoke-WPFUIThread ($ScriptBlock) {
|
||||
$sync.form.Dispatcher.Invoke([action]$ScriptBlock)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user