From fe11d3335998f0dd71cb820617bc0e71a24a972b Mon Sep 17 00:00:00 2001 From: jpattWPC Date: Thu, 21 Apr 2022 11:27:23 -0500 Subject: [PATCH] Update vdiclient.py Fix TKinter integer requirement --- vdiclient.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/vdiclient.py b/vdiclient.py index c60f712..3934c11 100644 --- a/vdiclient.py +++ b/vdiclient.py @@ -2,8 +2,10 @@ import proxmoxer # pip install proxmoxer try: import PySimpleGUIQt as sg # pip install PySimpleGUIQt + gui = 'QT' except ImportError: import PySimpleGUI as sg # pip install PySimpleGUI + gui = 'TK' import requests from configparser import ConfigParser import random @@ -135,6 +137,7 @@ def loadconfig(config_location = None): def win_popup(message): layout = [[sg.Text(message)]] window = sg.Window('Message', layout, no_titlebar=True, keep_on_top=True, finalize=True) + window.bring_to_front() return window def win_popup_button(message, button): @@ -395,10 +398,13 @@ def showvms(): return True def main(): - if os.name == 'nt': + if os.name == 'nt' and gui == 'QT': G.scaling = get_dpi() else: - G.scaling = 1.0 #TODO FIXME: Figure out scaling on Linux + if gui == 'QT': + G.scaling = 1.0 #TODO FIXME: Figure out scaling on Linux + else: + G.scaling = 1 # TKinter requires integers config_location = None if len(sys.argv) > 1: if sys.argv[1] == '--list_themes':