Skip to content

Commit

Permalink
ensure older windows os's have teh min/max buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
th3w1zard1 committed Aug 18, 2024
1 parent 73c9d60 commit a58e54c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 26 deletions.
8 changes: 7 additions & 1 deletion Tools/HolocronToolset/src/toolset/gui/dialogs/asyncloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,13 @@ def __init__(
- Connects callbacks for successful/failed task completion.
"""
super().__init__(parent)
self.setWindowFlags(QtCore.Qt.Dialog | QtCore.Qt.WindowCloseButtonHint | QtCore.Qt.WindowStaysOnTopHint & ~QtCore.Qt.WindowContextHelpButtonHint & ~QtCore.Qt.WindowMinMaxButtonsHint)
self.setWindowFlags(
QtCore.Qt.Dialog
| QtCore.Qt.WindowCloseButtonHint
| QtCore.Qt.WindowStaysOnTopHint
| QtCore.Qt.WindowMinMaxButtonsHint # Enable minimize/maximize buttons
& ~QtCore.Qt.WindowContextHelpButtonHint
)
print("AsyncLoader.__init__: realtime_progress:", realtime_progress)

self._progressBar = AnimatedProgressBar(self)
Expand Down
61 changes: 36 additions & 25 deletions install_python_venv.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,10 @@ $latestSetuptoolsUrl = "https://files.pythonhosted.org/packages/4d/5b/dc575711b6
$global:pythonInstallPath = ""
$global:pythonVersion = ""

$repoRootPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
function Get-OS {
if ($IsWindows) {
return "Windows"
} elseif ($IsMacOS) {
return "Mac"
} elseif ($IsLinux) {
return "Linux"
}
$os = (Get-WmiObject -Class Win32_OperatingSystem).Caption
if ($os -match "Windows") {
return "Windows"
} elseif ($os -match "Mac") {
return "Mac"
} elseif ($os -match "Linux") {
return "Linux"
} else {
Write-Error "Unknown Operating System"
Write-Host "Press any key to exit..."
if (-not $noprompt) {
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
}
exit
}
}
$scriptPath = $MyInvocation.MyCommand.Definition # Absolute path to this script.
$repoRootPath = (Resolve-Path -LiteralPath "$scriptPath/..").Path # Path to PyKotor repo root.
Write-Host "The path to the script directory is: $scriptPath"
Write-Host "The path to the root directory is: $repoRootPath"

function Handle-Error {
param (
Expand Down Expand Up @@ -68,6 +47,38 @@ function Handle-Error {
}
}

trap {
Write-Error "An error occurred: $_"
$response = Read-Host "Press Enter to continue or type 'q' or the hotkey `ctrl+c` to quit."
if ($response -eq 'exit') { exit }
continue
}

function Get-OS {
if ($IsWindows) {
return "Windows"
} elseif ($IsMacOS) {
return "Mac"
} elseif ($IsLinux) {
return "Linux"
}
$os = (Get-WmiObject -Class Win32_OperatingSystem).Caption
if ($os -match "Windows") {
return "Windows"
} elseif ($os -match "Mac") {
return "Mac"
} elseif ($os -match "Linux") {
return "Linux"
} else {
Write-Error "Unknown Operating System"
Write-Host "Press any key to exit..."
if (-not $noprompt) {
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
}
exit
}
}


function Invoke-BashCommand {
param (
Expand Down

0 comments on commit a58e54c

Please sign in to comment.