Skip to content
This repository has been archived by the owner on Dec 29, 2023. It is now read-only.

Commit

Permalink
Merge pull request #318 from srevinsaju/work/srevin/readd-pyqt5
Browse files Browse the repository at this point in the history
feat: add PyQt5 support for supporting flatpak
  • Loading branch information
srevinsaju authored Jul 18, 2022
2 parents ab2e8c9 + 47eebe8 commit 66249d4
Showing 1 changed file with 30 additions and 6 deletions.
36 changes: 30 additions & 6 deletions guiscrcpy/ux/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,34 @@
import os

# flake8: noqa
has_pyside2 = False
has_pyqt5 = False

from guiscrcpy.ui.pyside2.main import Ui_MainWindow # noqa: F401
from guiscrcpy.ui.pyside2.network import Ui_NetworkUI # noqa: F401
from guiscrcpy.ui.pyside2.panel import Ui_HorizontalPanel # noqa: F401
from guiscrcpy.ui.pyside2.settings import Ui_MainWindow as Ui_SettingsWindow
from guiscrcpy.ui.pyside2.downloader import Ui_Initializer # noqa: F401
from guiscrcpy.ui.pyside2.toolkit import Ui_ToolbarPanel # noqa: F401
try:
import PySide2

has_pyside2 = True
except ModuleNotFoundError:
try:
import PyQt5

has_pyqt5 = True
except ModuleNotFoundError:
raise ModuleNotFoundError(
"Did not find either 'PyQt5' or 'PySide2' installations"
)

if has_pyside2:
from guiscrcpy.ui.pyside2.main import Ui_MainWindow # noqa: F401
from guiscrcpy.ui.pyside2.network import Ui_NetworkUI # noqa: F401
from guiscrcpy.ui.pyside2.panel import Ui_HorizontalPanel # noqa: F401
from guiscrcpy.ui.pyside2.settings import Ui_MainWindow as Ui_SettingsWindow
from guiscrcpy.ui.pyside2.downloader import Ui_Initializer # noqa: F401
from guiscrcpy.ui.pyside2.toolkit import Ui_ToolbarPanel # noqa: F401
elif has_pyqt5:
from guiscrcpy.ui.pyqt5.main import Ui_MainWindow # noqa: F401
from guiscrcpy.ui.pyqt5.network import Ui_NetworkUI # noqa: F401
from guiscrcpy.ui.pyqt5.panel import Ui_HorizontalPanel # noqa: F401
from guiscrcpy.ui.pyqt5.settings import Ui_MainWindow as Ui_SettingsWindow
from guiscrcpy.ui.pyqt5.downloader import Ui_Initializer # noqa: F401
from guiscrcpy.ui.pyqt5.toolkit import Ui_ToolbarPanel # noqa: F401

0 comments on commit 66249d4

Please sign in to comment.