Avoid GraphicalUI if Windows Console
This commit is contained in:
parent
ea8cc8e666
commit
a5bbd1bdc7
@ -1,19 +1,21 @@
|
||||
import os
|
||||
from syncplay.utils import isWindowsConsole
|
||||
|
||||
if "QT_PREFERRED_BINDING" not in os.environ:
|
||||
os.environ["QT_PREFERRED_BINDING"] = os.pathsep.join(
|
||||
["PySide6", "PySide2", "PySide", "PyQt5", "PyQt4"]
|
||||
)
|
||||
|
||||
try:
|
||||
from syncplay.ui.gui import MainWindow as GraphicalUI
|
||||
except ImportError:
|
||||
pass
|
||||
if not isWindowsConsole:
|
||||
try:
|
||||
from syncplay.ui.gui import MainWindow as GraphicalUI
|
||||
except ImportError:
|
||||
pass
|
||||
from syncplay.ui.consoleUI import ConsoleUI
|
||||
|
||||
|
||||
def getUi(graphical=True, passedBar=None):
|
||||
if graphical:
|
||||
if graphical and not isWindowsConsole:
|
||||
ui = GraphicalUI(passedBar=passedBar)
|
||||
else:
|
||||
ui = ConsoleUI()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user