mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Configure and model install TUI tweaks (#3519)
The installer TUI requires a minimum window width and height to provide a satisfactory user experience. If, after trying and exhausting all means of enlarging the window (on Linux, Mac and Windows) the window is still too small, this PR generates a message telling the user to enlarge the window and pausing until they do so. If the user fails to enlarge the window the program will proceed, and either issue an error message that it can't continue (on Windows), or show a clipped display that the user can remedy by enlarging the window.
This commit is contained in:
commit
3c30368c62
@ -38,6 +38,7 @@ echo https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist
|
|||||||
echo.
|
echo.
|
||||||
echo See %INSTRUCTIONS% for more details.
|
echo See %INSTRUCTIONS% for more details.
|
||||||
echo.
|
echo.
|
||||||
|
echo "For the best user experience we suggest enlarging or maximizing this window now."
|
||||||
pause
|
pause
|
||||||
|
|
||||||
@rem ---------------------------- check Python version ---------------
|
@rem ---------------------------- check Python version ---------------
|
||||||
|
@ -26,6 +26,7 @@ done
|
|||||||
if [ -z "$PYTHON" ]; then
|
if [ -z "$PYTHON" ]; then
|
||||||
echo "A suitable Python interpreter could not be found"
|
echo "A suitable Python interpreter could not be found"
|
||||||
echo "Please install Python $MINIMUM_PYTHON_VERSION or higher (maximum $MAXIMUM_PYTHON_VERSION) before running this script. See instructions at $INSTRUCTIONS for help."
|
echo "Please install Python $MINIMUM_PYTHON_VERSION or higher (maximum $MAXIMUM_PYTHON_VERSION) before running this script. See instructions at $INSTRUCTIONS for help."
|
||||||
|
echo "For the best user experience we suggest enlarging or maximizing this window now."
|
||||||
read -p "Press any key to exit"
|
read -p "Press any key to exit"
|
||||||
exit -1
|
exit -1
|
||||||
fi
|
fi
|
||||||
|
@ -293,6 +293,8 @@ def introduction() -> None:
|
|||||||
"3. Create initial configuration files.",
|
"3. Create initial configuration files.",
|
||||||
"",
|
"",
|
||||||
"[i]At any point you may interrupt this program and resume later.",
|
"[i]At any point you may interrupt this program and resume later.",
|
||||||
|
"",
|
||||||
|
"[b]For the best user experience, please enlarge or maximize this window",
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -965,13 +965,15 @@ def main():
|
|||||||
logger.error(
|
logger.error(
|
||||||
"Insufficient vertical space for the interface. Please make your window taller and try again"
|
"Insufficient vertical space for the interface. Please make your window taller and try again"
|
||||||
)
|
)
|
||||||
elif str(e).startswith("addwstr"):
|
input('Press any key to continue...')
|
||||||
|
except Exception as e:
|
||||||
|
if str(e).startswith("addwstr"):
|
||||||
logger.error(
|
logger.error(
|
||||||
"Insufficient horizontal space for the interface. Please make your window wider and try again."
|
"Insufficient horizontal space for the interface. Please make your window wider and try again."
|
||||||
)
|
)
|
||||||
except Exception as e:
|
else:
|
||||||
print(f'An exception has occurred: {str(e)} Details:')
|
print(f'An exception has occurred: {str(e)} Details:')
|
||||||
print(traceback.format_exc(), file=sys.stderr)
|
print(traceback.format_exc(), file=sys.stderr)
|
||||||
input('Press any key to continue...')
|
input('Press any key to continue...')
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,6 +42,18 @@ def set_terminal_size(columns: int, lines: int, launch_command: str=None):
|
|||||||
elif OS in ["Darwin", "Linux"]:
|
elif OS in ["Darwin", "Linux"]:
|
||||||
_set_terminal_size_unix(width,height)
|
_set_terminal_size_unix(width,height)
|
||||||
|
|
||||||
|
# check whether it worked....
|
||||||
|
ts = get_terminal_size()
|
||||||
|
pause = False
|
||||||
|
if ts.columns < columns:
|
||||||
|
print('\033[1mThis window is too narrow for the user interface. Please make it wider.\033[0m')
|
||||||
|
pause = True
|
||||||
|
if ts.lines < lines:
|
||||||
|
print('\033[1mThis window is too short for the user interface. Please make it taller.\033[0m')
|
||||||
|
pause = True
|
||||||
|
if pause:
|
||||||
|
input('Press any key to continue..')
|
||||||
|
|
||||||
def _set_terminal_size_powershell(width: int, height: int):
|
def _set_terminal_size_powershell(width: int, height: int):
|
||||||
script=f'''
|
script=f'''
|
||||||
$pshost = get-host
|
$pshost = get-host
|
||||||
|
Loading…
Reference in New Issue
Block a user