mirror of
https://github.com/kbumsik/VirtScreen.git
synced 2025-03-09 15:40:18 +00:00
main.py: delted Twisted code, added Qt application name
This commit is contained in:
parent
451ada820b
commit
9b8c1a71a4
1 changed files with 3 additions and 6 deletions
|
@ -29,6 +29,7 @@ from .path import HOME_PATH, ICON_PATH, MAIN_QML_PATH, CONFIG_PATH
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
|
"""Start main program"""
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
formatter_class=argparse.RawTextHelpFormatter,
|
formatter_class=argparse.RawTextHelpFormatter,
|
||||||
description='Make your iPad/tablet/computer as a secondary monitor on Linux.\n\n'
|
description='Make your iPad/tablet/computer as a secondary monitor on Linux.\n\n'
|
||||||
|
@ -77,6 +78,7 @@ def main() -> None:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
def check_env(msg: Callable[[str], None]) -> None:
|
def check_env(msg: Callable[[str], None]) -> None:
|
||||||
|
"""Check enveironments before start"""
|
||||||
if os.environ['XDG_SESSION_TYPE'].lower() == 'wayland':
|
if os.environ['XDG_SESSION_TYPE'].lower() == 'wayland':
|
||||||
msg("Currently Wayland is not supported")
|
msg("Currently Wayland is not supported")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
@ -113,14 +115,9 @@ def main_gui():
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
check_env(dialog)
|
check_env(dialog)
|
||||||
|
|
||||||
# Replace Twisted reactor with qt5reactor
|
app.setApplicationName("VirtScreen")
|
||||||
import qt5reactor # pylint: disable=E0401
|
|
||||||
qt5reactor.install()
|
|
||||||
from twisted.internet import reactor # pylint: disable=E0401
|
|
||||||
|
|
||||||
app.setWindowIcon(QIcon(ICON_PATH))
|
app.setWindowIcon(QIcon(ICON_PATH))
|
||||||
os.environ["QT_QUICK_CONTROLS_STYLE"] = "Material"
|
os.environ["QT_QUICK_CONTROLS_STYLE"] = "Material"
|
||||||
# os.environ["QT_QUICK_CONTROLS_STYLE"] = "Fusion"
|
|
||||||
|
|
||||||
# Register the Python type. Its URI is 'People', it's v1.0 and the type
|
# Register the Python type. Its URI is 'People', it's v1.0 and the type
|
||||||
# will be called 'Person' in QML.
|
# will be called 'Person' in QML.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue