diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml deleted file mode 100644 index 2e3a5043..00000000 --- a/.github/workflows/appimage.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Build AppImage -on: [push] - -jobs: - build: - name: AppImage - runs-on: ubuntu-latest - steps: - - name: Dependencies - run: | - sudo apt install libsnappy-dev libsqlite3-dev desktop-file-utils python3-virtualenv python3-venv - sudo pip3 install virtualenv - sudo ln -s /usr/lib/python3/dist-packages/virtualenv.py /usr/local/bin/virtualenv - sudo chmod +x /usr/local/bin/virtualenv - - uses: actions/checkout@v1 - with: - fetch-depth: 1 - - name: get Bundle - run: | - git clone https://github.com/AppImage/pkg2appimage.git --depth=1 - cd pkg2appimage - chmod +x ./pkg2appimage - ./pkg2appimage ../io.srevinsaju.guiscrcpy.yml - cd .. - ls - - - name: show dir - run: ls - - - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 - with: - # Artifact name - name: guiscrcpy.AppImage - # Directory containing files to upload - path: pkg2appimage/out/guiscrcpy-.glibc2.25-x86_64.AppImage diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md old mode 100755 new mode 100644 diff --git a/guiscrcpy-windows.spec b/guiscrcpy-windows.spec old mode 100755 new mode 100644 diff --git a/guiscrcpy.desktop b/guiscrcpy.desktop index 748c7723..7a9c5f41 100644 --- a/guiscrcpy.desktop +++ b/guiscrcpy.desktop @@ -1,9 +1,10 @@ [Desktop Entry] Name=guiscrcpy +Version=3.5 Exec=python3 bin/guiscrcpy Type=Application Icon=guiscrcpy_logo Terminal=false Categories=Application;Development; Keywords=Python;Screen;Mirroring;Android -StartupWMClass=guiscrcpy \ No newline at end of file +StartupWMClass=guiscrcpy diff --git a/guiscrcpy/__init__.py b/guiscrcpy/__init__.py index cda202b8..bac4f696 100644 --- a/guiscrcpy/__init__.py +++ b/guiscrcpy/__init__.py @@ -16,4 +16,3 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . """ - diff --git a/guiscrcpy/__main__.py b/guiscrcpy/__main__.py index 85aa2148..b3350b58 100644 --- a/guiscrcpy/__main__.py +++ b/guiscrcpy/__main__.py @@ -18,6 +18,6 @@ """ -print("Running guiscrcpy as a python module") from guiscrcpy.launcher import bootstrap +print("Running guiscrcpy as a python module") bootstrap() diff --git a/guiscrcpy/install/finder.py b/guiscrcpy/install/finder.py new file mode 100644 index 00000000..b49f86cb --- /dev/null +++ b/guiscrcpy/install/finder.py @@ -0,0 +1,14 @@ +import os +import sys +from PyQt5.QtWidgets import QFileDialog + + +def openFileNameDialog(parent, appname): + options = QFileDialog.Options() + options |= QFileDialog.DontUseNativeDialog + fileName, _ = \ + QFileDialog.getOpenFileName(parent, "{} could not be found. Please locate it manually".format(appname), + "", "Valid {} executable (*);;".format(appname), options=options) + if fileName: + print(fileName) + return fileName diff --git a/guiscrcpy/launcher.py b/guiscrcpy/launcher.py index 07048979..a948d516 100644 --- a/guiscrcpy/launcher.py +++ b/guiscrcpy/launcher.py @@ -65,12 +65,16 @@ except FileNotFoundError: pass # Its a PyInstaller compiled package +# create app + + # initialize config manager cfgmgr = InterfaceConfig() config = cfgmgr.get_config() environment = platform.System() adb.path = config['adb'] scrcpy.path = config['scrcpy'] +scrcpy.server_path = config['scrcpy-server'] v = version() # Initialize argument parser @@ -141,11 +145,11 @@ logging.debug("Importing modules...") -class InterfaceGuiscrcpy(Ui_MainWindow): - def __init__(self, Ui_MainWindow): - Ui_MainWindow.__init__() - self.setupUi(Ui_MainWindow) - super(InterfaceGuiscrcpy, self).__init__() +class InterfaceGuiscrcpy(QMainWindow, Ui_MainWindow): + def __init__(self): + QMainWindow.__init__(self) + Ui_MainWindow.__init__(self) + self.setupUi(self) self.cmx = None logging.debug( "Options received by class are : {} {} {} {} {} ".format( @@ -465,20 +469,37 @@ def bootstrap0(): app.setStyle('Breeze') app.setStyleSheet(darkstylesheet()) - window = QtWidgets.QMainWindow() # Create windwo - prog = InterfaceGuiscrcpy(window) - splash_pix = QPixmap(":/res/ui/guiscrcpy-branding.png") splash = QtWidgets.QSplashScreen(splash_pix) splash.setMask(splash_pix.mask()) splash.show() app.processEvents() + cfedited = False - adb.devices(adb.path) + from guiscrcpy.install.finder import openFileNameDialog + if adb.path is None: + adb.path = openFileNameDialog(None, 'adb') + cfedited = True + config['adb'] = adb.path - app.processEvents() + if scrcpy.path is None: + scrcpy.path = openFileNameDialog(None, 'scrcpy') + cfedited = True + config['scrcpy'] = scrcpy.path + + if (scrcpy.server_path is None) and (platform.System() == 'Windows'): + scrcpy.server_path = openFileNameDialog(None, 'scrcpy-server') + cfedited = True + config['scrcpy-server'] = scrcpy.server_path - window.show() + if cfedited: + cfgmgr.update_config(config) + cfgmgr.write_file() + + adb.devices(adb.path) + prog = InterfaceGuiscrcpy() + prog.show() + app.processEvents() splash.hide() app.exec_() sys.exit() diff --git a/guiscrcpy/lib/check.py b/guiscrcpy/lib/check.py index 9bf9c23c..8e003b2d 100644 --- a/guiscrcpy/lib/check.py +++ b/guiscrcpy/lib/check.py @@ -50,7 +50,8 @@ def device(): @staticmethod def check(): - scrcpy_path = check_existence(environment.paths(), ['scrcpy'], False, True) + scrcpy_path = check_existence( + environment.paths(), ['scrcpy'], False, True) if scrcpy_path and (type(scrcpy_path) is list): return scrcpy_path[0] else: @@ -95,7 +96,8 @@ def get_dimensions(path): return dimValues else: logging.error( - "AndroidDeviceError: adb shell wm size did not return 'Physical Size' or 'Override Size'") + "AndroidDeviceError: adb shell wm size did not return 'Physical Size' or 'Override Size'" + ) return False @staticmethod @@ -116,7 +118,6 @@ def command(path, command): ) return shellx - @staticmethod def devices(increment=''): if increment is None: diff --git a/guiscrcpy/lib/config.py b/guiscrcpy/lib/config.py index 27c0e79f..7a2f124b 100644 --- a/guiscrcpy/lib/config.py +++ b/guiscrcpy/lib/config.py @@ -35,6 +35,7 @@ def __init__(self, mode='w'): 'paths': self.paths, 'scrcpy': None, 'adb': None, + 'scrcpy-server': None, 'dimension': None, 'swtouches': False, 'bitrate': 8000, @@ -57,6 +58,8 @@ def validate(self): scrcpy_path = scrcpy.check() if scrcpy_path: self.config['scrcpy'] = scrcpy_path + if (self.config['scrcpy-server'] is not None) and (platform.System() == "Windows"): + os.environ['SCRCPY_SERVER_PATH'] = self.config['scrcpy-server'] return True def get_config(self): @@ -90,6 +93,10 @@ def check_file(self): if not os.path.exists(self.cfgpath): os.mkdir(self.cfgpath) if not os.path.exists(os.path.join(self.cfgpath, self.jsonfile)): + if (self.os.system() == 'Linux') or (self.os.system() == 'Windows'): + self.os.create_desktop() + self.os.install_fonts() + self.write_file() self.read_file() diff --git a/guiscrcpy/lib/mapper.py b/guiscrcpy/lib/mapper.py index d542b5de..8a32a71e 100644 --- a/guiscrcpy/lib/mapper.py +++ b/guiscrcpy/lib/mapper.py @@ -17,7 +17,8 @@ along with this program. If not, see . """ - +from guiscrcpy.lib.config import InterfaceConfig +from guiscrcpy.lib.check import adb import argparse from subprocess import PIPE, Popen from pynput import keyboard @@ -37,16 +38,11 @@ fixedpos = [0, 0] finalpos = [0, 0] +cfgmgr = InterfaceConfig() +config = cfgmgr.get_config() +adb.path = config['adb'] jsong = 'guiscrcpy.mapper.json' -if platform.system() == "Windows": - if os.path.isfile("./scrcpy.exe"): - increment = ".\\" - # print(bcolors.BOLD + "LOG: Found scrcpy.exe in current directory.") - else: - increment = "" -else: - increment = "" print("+++++++++++++++++++++++++++++++++++++++") print("guiscrcpy ~ mapper by srevinsaju") @@ -55,19 +51,10 @@ print('With USB debugging turned on.') print("+++++++++++++++++++++++++++++++++++++++") print("Waiting for device") -po(increment + "adb wait-for-any-device", shell=True) +adb.command(adb.path, 'wait-for-any-device') print("Device : OK!") - -# Declare key_a. path position -if (platform.system() == 'Windows'): - cfgpath = os.path.expanduser("~/AppData/Local/guiscrcpy/") -else: - if (os.getenv('XDG_CONFIG_HOME') is None): - cfgpath = os.path.expanduser("~/.config/guiscrcpy/") - else: - cfgpath = os.getenv('XDG_CONFIG_HOME').split(":")[0] + "/guiscrcpy/" - +cfgpath = cfgmgr.cfgpath parser = argparse.ArgumentParser() parser.add_argument('-t', '--delay', default=10, @@ -76,20 +63,7 @@ help="Remove prefernces") args = parser.parse_args() -adb_dim = po( - "adb shell wm size", shell=True, stdout=PIPE, stderr=PIPE -) - -out = adb_dim.stdout.read() -out_decoded = out.decode("utf-8") -out_decoded = out_decoded[:-1] -dimVal = out_decoded.split(": ") -try: - dimensions_ = dimVal[1] - dimValues = dimensions_.split("x") - print(dimValues, " DIMENSIONS ") -except: - print("Error Device not connected") +dimensions = adb.get_dimensions(adb.path) class MapperUI(QtWidgets.QWidget): @@ -181,8 +155,8 @@ def keyreg(self): #print("REL POS :: ", fixedpos) relx = fixedpos[0]/self.label.width() rely = fixedpos[1]/self.label.height() - fixx = relx * int(dimValues[0]) - fixy = rely * int(dimValues[1]) + fixx = relx * int(dimensions[0]) + fixy = rely * int(dimensions[1]) print("FINALIZED POS :: ", fixx, fixy) finalpos[0] = fixx @@ -255,7 +229,6 @@ def on_press0(key): try: if key.char in key_a.keys(): - print(key.char) print("running cmd") finalpos0 = key_a[key.char] @@ -278,17 +251,11 @@ def on_press0(key): def sth(): import sys - app = QtWidgets.QApplication(sys.argv) window = MapperUI() - sys.exit(app.exec_()) -def sth_w0(): - pass - - def file_check(): jsong = 'guiscrcpy.mapper.json' @@ -373,15 +340,13 @@ def file_checkm(): ) if not fileExist: - # Init json file for first time use key_a = {"key": [], "pos": []} - with open(cfgpath + jsong, 'w') as f: + with open(os.path.join(cfgpath, jsong), 'w') as f: json.dump(key_a, f) - sth_w0() elif fileExist: - with open(cfgpath + jsong, 'r') as f: + with open(os.path.join(cfgpath, jsong), 'r') as f: key_a = json.load(f) listen_keypress(key_a) diff --git a/guiscrcpy/lib/process.py b/guiscrcpy/lib/process.py index dda1b94e..71a7258f 100644 --- a/guiscrcpy/lib/process.py +++ b/guiscrcpy/lib/process.py @@ -17,17 +17,21 @@ along with this program. If not, see . """ - -import psutil +try: + import psutil + psutil_present = True +except ModuleNotFoundError: + psutil_present = False def is_running(processName): - # Iterate over the all the running process - for proc in psutil.process_iter(): - try: - # Check if process name contains the given name string. - if processName.lower() in proc.name().lower(): - return True - except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess): - pass + if psutil_present: + # Iterate over the all the running process + for proc in psutil.process_iter(): + try: + # Check if process name contains the given name string. + if processName.lower() in proc.name().lower(): + return True + except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess): + pass return False diff --git a/guiscrcpy/lib/utils.py b/guiscrcpy/lib/utils.py index 17885b16..fc1ed746 100644 --- a/guiscrcpy/lib/utils.py +++ b/guiscrcpy/lib/utils.py @@ -30,8 +30,10 @@ def shellify(args): else: return shlex.split(args) + _ = shellify + def decode(raw_output): pass diff --git a/guiscrcpy/lib/ver.py b/guiscrcpy/lib/ver.py index d955dca5..acee7c31 100644 --- a/guiscrcpy/lib/ver.py +++ b/guiscrcpy/lib/ver.py @@ -18,7 +18,7 @@ """ -__version__ = '3.2-raw' +__version__ = '3.4-raw' import logging try: import git diff --git a/guiscrcpy/network/network.py b/guiscrcpy/network/network.py index 372b3c9a..c3667354 100644 --- a/guiscrcpy/network/network.py +++ b/guiscrcpy/network/network.py @@ -31,7 +31,6 @@ def pinger(self, job_q, results_q): except: pass - def get_my_ip(self): """ Find my IP address @@ -43,7 +42,6 @@ def get_my_ip(self): s.close() return ip - def map_network(self, pool_size=255): """ Maps the network @@ -61,7 +59,8 @@ def map_network(self, pool_size=255): jobs = multiprocessing.Queue() results = multiprocessing.Queue() - pool = [multiprocessing.Process(target=self.pinger, args=(jobs, results)) for i in range(pool_size)] + pool = [multiprocessing.Process(target=self.pinger, args=( + jobs, results)) for i in range(pool_size)] for p in pool: p.start() diff --git a/guiscrcpy/platform/darwin.py b/guiscrcpy/platform/darwin.py index f07951cd..4e1cb72e 100644 --- a/guiscrcpy/platform/darwin.py +++ b/guiscrcpy/platform/darwin.py @@ -23,7 +23,8 @@ class Darwin: def __init__(self): - logging.error("MacOS is untested. guiscrcpy is trying to use Linux config on Mac") + logging.error( + "MacOS is untested. guiscrcpy is trying to use Linux config on Mac") def cfgpath(self): return self.make_config() diff --git a/guiscrcpy/platform/linux.py b/guiscrcpy/platform/linux.py index f8faad30..1d040fcf 100644 --- a/guiscrcpy/platform/linux.py +++ b/guiscrcpy/platform/linux.py @@ -19,6 +19,23 @@ import logging import os +import shutil + +from guiscrcpy.lib.ver import version + +desktop = \ + """ +[Desktop Entry] +Version={v} +Name=guiscrcpy +GenericName=guiscrcpy +Comment=Open Source Android Screen Mirroring System +Exec=guiscrcpy +Icon={icon_path} +Type=Application +Categories=Utility;Development; +StartupWMClass=UGENE +""" class Linux: @@ -28,8 +45,7 @@ def __init__(self): def cfgpath(self): return self.make_config() - @staticmethod - def make_config(): + def make_config(self): if os.getenv('XDG_CONFIG_HOME') is None: path = os.path.expanduser("~/.config/guiscrcpy/") else: @@ -46,7 +62,65 @@ def make_config(): )) return path - def system(self): + def create_desktop(self): + """ + Create Desktop file for Linux in ~/.local level + :return: + """ + v = version() + ver = v.get_commit() + + desk = desktop.format( + v=ver, + icon_path=os.path.join(os.path.abspath(os.path.dirname(os.path.dirname(__file__))), + 'ui', 'ui', 'guiscrcpy_logo.png')) + if os.getenv('XDG_DESKTOP_DIR'): + desktop_dir = os.getenv('XDG_DESKTOP_DIR') + else: + if os.path.exists(os.path.expanduser('~/Desktop')): + desktop_dir = os.path.expanduser('~/Desktop') + elif os.path.exists(os.path.expanduser('~/desktop')): + desktop_dir = os.path.expanduser('~/desktop') + else: + desktop_dir = False + if desktop_dir: + with open(os.path.join(desktop_dir, 'guiscrcpy.desktop'), 'w') as w: + w.write(desk) + with open(os.path.join(os.path.expanduser('~/.local/share/applications/'), 'guiscrcpy.desktop'), 'w') as w: + w.write(desk) + + return True + else: + return False + + @staticmethod + def install_fonts(): + """ + Install fonts to ~/.fonts. + The fonts being installed is Titillium Web ~ https://fonts.google.com/specimen/Titillium+Web + Open Source Approved fonts. + # TODO support for SystemWide Installation + :return: True if installation successful, else False + """ + sys_font_dir = os.path.join(os.path.expanduser('~'), '.fonts') + if not os.path.exists(sys_font_dir): + os.makedirs(sys_font_dir) + from fontTools.ttLib import TTFont + font_dir = os.path.join(os.path.abspath(os.path.dirname(os.path.dirname(__file__))), 'ui', 'fonts') + try: + fonts = os.listdir(font_dir) + for i in fonts: + font = TTFont(os.path.join(font_dir, i)) + font.save(os.path.join(sys_font_dir, i)) + return True + except Exception as e: + logging.error("Error Installing the fonts. " + "You might have to manually install the fonts" + "Titillium Web : https://fonts.google.com/specimen/Titillium+Web") + return False + + @staticmethod + def system(): return 'Linux' def increment(self): diff --git a/guiscrcpy/platform/windows.py b/guiscrcpy/platform/windows.py index 57a59899..ef1c1a22 100644 --- a/guiscrcpy/platform/windows.py +++ b/guiscrcpy/platform/windows.py @@ -19,6 +19,7 @@ import logging import os +from guiscrcpy.platform.windows_tools.tools import make_shortcut class Windows: @@ -28,14 +29,15 @@ def __init__(self): @staticmethod def make_config(): - path = os.path.expanduser(os.path.join("~", "AppData", "Local", "guiscrcpy")) + path = os.path.expanduser(os.path.join( + "~", "AppData", "Local", "guiscrcpy")) if not os.path.exists(path): try: os.makedirs(path) except Exception as e: logging.error( "Error creating configuration file in dir {path}. Error code:{e}" - .format( + .format( path=path, e=e )) @@ -51,4 +53,35 @@ def increment(self): pass def paths(self): - return ['bin'] \ No newline at end of file + return ['bin'] + + def install_fonts(self): + """ + Install fonts to system directory. + The fonts being installed is Titillium Web ~ https://fonts.google.com/specimen/Titillium+Web + Open Source Approved fonts. + # TODO support for SystemWide Installation + :return: True if installation successful, else False + """ + # TODO: Test it properly + # Likely to fail + cmd = r"""copy "{fontdir}" "%WINDIR%\Fonts" + reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" / + v "FontName (TrueType)" / t REG_SZ / d {font} / f """ + font_dir = os.path.join(os.path.abspath(os.path.dirname(os.path.dirname(__file__))), 'ui', 'fonts') + try: + fonts = os.listdir(font_dir) + for i in fonts: + # install the fonts by executing cmd and update the Windows Registry + print(cmd.format(font=i, fontdir=os.path.join(font_dir, i))) + os.system(cmd.format(font=i, fontdir=os.path.join(font_dir, i))) + return True + except Exception as e: + print("Installing fonts failed") + logging.error("Error Installing the fonts. " + "You might have to manually install the fonts" + "Titillium Web : https://fonts.google.com/specimen/Titillium+Web") + return False + + def create_desktop(self): + make_shortcut() diff --git a/guiscrcpy/install/installer.py b/guiscrcpy/platform/windows_tools/shortcut.py similarity index 100% rename from guiscrcpy/install/installer.py rename to guiscrcpy/platform/windows_tools/shortcut.py diff --git a/guiscrcpy/platform/windows_tools/tools.py b/guiscrcpy/platform/windows_tools/tools.py new file mode 100644 index 00000000..d58a516f --- /dev/null +++ b/guiscrcpy/platform/windows_tools/tools.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python +""" +Create desktop shortcuts for Windows +""" +from __future__ import print_function +import os +import sys +import time +from collections import namedtuple +UserFolders = namedtuple("UserFolders", ("home", "desktop", "startmenu")) +import win32com.client +from win32com.shell import shell, shellcon + +scut_ext = 'lnk' +ico_ext = 'ico' + +def get_conda_active_env(): + '''Return name of active conda environment or empty string''' + conda_env = None + try: + conda_env = os.environ['CONDA_DEFAULT_ENV'] + except KeyError: + print("No conda env active, defaulting to base") + conda_env = "" + return conda_env + +# batch file to activate the environment +# for Anaconda Python before running command. +conda_env = get_conda_active_env() +ENVRUNNER = """ +@ECHO OFF +call %~dp0%activate {0} +echo # run in conda environment "%CONDA_DEFAULT_ENV%": +echo # %* +%* +""".format(conda_env) + +_WSHELL = win32com.client.Dispatch("Wscript.Shell") + + +# Windows Special Folders +# see: https://docs.microsoft.com/en-us/windows/win32/shell/csidl + +def get_homedir(): + '''Return home directory: + note that we return CSIDL_PROFILE, not + CSIDL_APPDATA, CSIDL_LOCAL_APPDATA, or CSIDL_COMMON_APPDATA + ''' + return shell.SHGetFolderPath(0, shellcon.CSIDL_PROFILE, None, 0) + + +def get_desktop(): + '''Return user Desktop folder''' + return shell.SHGetFolderPath(0, shellcon.CSIDL_DESKTOP, None, 0) + + +def get_startmenu(): + '''Return user Start Menu Programs folder + note that we return CSIDL_PROGRAMS not CSIDL_COMMON_PROGRAMS + ''' + return shell.SHGetFolderPath(0, shellcon.CSIDL_PROGRAMS, None, 0) + + +def get_folders(): + """get user-specific folders + Returns: + ------- + Named tuple with fields 'home', 'desktop', 'startmenu' + Example: + ------- + >>> from pyshortcuts import get_folders + >>> folders = get_folders() + >>> print("Home, Desktop, StartMenu ", + ... folders.home, folders.desktop, folders.startmenu) + """ + return UserFolders(get_homedir(), get_desktop(), get_startmenu()) + +def make_shortcut(): + userfolders = get_folders() + + full_script = 'guiscrcpy' + desktop, startmenu = True, True + for (create, folder) in ((desktop,userfolders.desktop), + (startmenu, userfolders.startmenu)): + + if not os.path.exists(folder): + os.makedirs(folder) + dest = os.path.join(folder, "guiscrcpy.lnk") + + wscript = _WSHELL.CreateShortCut(dest) + wscript.Targetpath = 'guiscrcpy.exe' + wscript.WorkingDirectory = userfolders.home + wscript.WindowStyle = 0 + wscript.Description = "An Open Source Android Screen Mirroring System" + wscript.IconLocation = os.path.join(os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))), + 'ui', 'icons', 'guiscrcpy_logo_SRj_icon.ico') + wscript.save() + + return True \ No newline at end of file diff --git a/guiscrcpy/theme/style.py b/guiscrcpy/theme/style.py index 17456e4b..f41d81bf 100644 --- a/guiscrcpy/theme/style.py +++ b/guiscrcpy/theme/style.py @@ -17,6 +17,7 @@ along with this program. If not, see . """ + def darkstylesheet(): # DarkStyleSheet diff --git a/guiscrcpy/ui/downloader.py b/guiscrcpy/ui/downloader.py new file mode 100644 index 00000000..56620cf3 --- /dev/null +++ b/guiscrcpy/ui/downloader.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'guiscrcpy/ui/downloader.ui' +# +# Created by: PyQt5 UI code generator 5.14.1 +# +# WARNING! All changes made in this file will be lost! + + +from . import rsrc_rc +from PyQt5 import QtCore, QtGui, QtWidgets + + +class Ui_Initializer(object): + def setupUi(self, Initializer): + Initializer.setObjectName("Initializer") + Initializer.resize(222, 320) + icon = QtGui.QIcon() + icon.addPixmap(QtGui.QPixmap(":/res/ui/guiscrcpy_logo.png"), + QtGui.QIcon.Normal, QtGui.QIcon.Off) + Initializer.setWindowIcon(icon) + self.widget = QtWidgets.QWidget(Initializer) + self.widget.setGeometry(QtCore.QRect(0, 0, 221, 311)) + self.widget.setObjectName("widget") + self.verticalLayout = QtWidgets.QVBoxLayout(self.widget) + self.verticalLayout.setContentsMargins(0, 0, 0, 0) + self.verticalLayout.setObjectName("verticalLayout") + self.label_2 = QtWidgets.QLabel(self.widget) + self.label_2.setText("") + self.label_2.setTextFormat(QtCore.Qt.PlainText) + self.label_2.setPixmap(QtGui.QPixmap(":/res/ui/guiscrcpy_logo.png")) + self.label_2.setScaledContents(True) + self.label_2.setAlignment(QtCore.Qt.AlignCenter) + self.label_2.setWordWrap(True) + self.label_2.setObjectName("label_2") + self.verticalLayout.addWidget(self.label_2) + self.stat = QtWidgets.QLabel(self.widget) + font = QtGui.QFont() + font.setFamily("Titillium Web") + font.setPointSize(30) + font.setBold(True) + font.setWeight(75) + self.stat.setFont(font) + self.stat.setScaledContents(False) + self.stat.setAlignment(QtCore.Qt.AlignCenter) + self.stat.setObjectName("stat") + self.verticalLayout.addWidget(self.stat) + self.label_3 = QtWidgets.QLabel(self.widget) + self.label_3.setAlignment(QtCore.Qt.AlignCenter) + self.label_3.setObjectName("label_3") + self.verticalLayout.addWidget(self.label_3) + + self.retranslateUi(Initializer) + QtCore.QMetaObject.connectSlotsByName(Initializer) + + def retranslateUi(self, Initializer): + _translate = QtCore.QCoreApplication.translate + Initializer.setWindowTitle(_translate("Initializer", "Initializing")) + self.stat.setText(_translate("Initializer", "guiscrcpy")) + self.label_3.setText(_translate("Initializer", "Initializing")) diff --git a/guiscrcpy/ui/downloader.ui b/guiscrcpy/ui/downloader.ui new file mode 100644 index 00000000..9039f1b2 --- /dev/null +++ b/guiscrcpy/ui/downloader.ui @@ -0,0 +1,93 @@ + + + Initializer + + + + 0 + 0 + 222 + 320 + + + + Initializing + + + + :/res/ui/guiscrcpy_logo.png:/res/ui/guiscrcpy_logo.png + + + + + 0 + 0 + 221 + 311 + + + + + + + + + + Qt::PlainText + + + :/res/ui/guiscrcpy_logo.png + + + true + + + Qt::AlignCenter + + + true + + + 15 + + + + + + + + Titillium Web + 30 + 75 + true + + + + guiscrcpy + + + false + + + Qt::AlignCenter + + + + + + + Initializing + + + Qt::AlignCenter + + + + + + + + + + + diff --git a/guiscrcpy/ui/fonts/OFL.txt b/guiscrcpy/ui/fonts/OFL.txt deleted file mode 100644 index 4a44b9b3..00000000 --- a/guiscrcpy/ui/fonts/OFL.txt +++ /dev/null @@ -1,93 +0,0 @@ -Copyright (c) 2009-2011 by Accademia di Belle Arti di Urbino and students of MA course of Visual design. Some rights reserved. - -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: -http://scripts.sil.org/OFL - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/guiscrcpy/ui/main.py b/guiscrcpy/ui/main.py index 6ac90ad5..c9e68a5c 100644 --- a/guiscrcpy/ui/main.py +++ b/guiscrcpy/ui/main.py @@ -7,6 +7,7 @@ # WARNING! All changes made in this file will be lost! +from . import rsrc_rc from PyQt5 import QtCore, QtGui, QtWidgets @@ -14,10 +15,12 @@ class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(547, 482) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.MinimumExpanding) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.MinimumExpanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + MainWindow.sizePolicy().hasHeightForWidth()) MainWindow.setSizePolicy(sizePolicy) MainWindow.setMinimumSize(QtCore.QSize(500, 420)) font = QtGui.QFont() @@ -25,73 +28,76 @@ def setupUi(self, MainWindow): font.setPointSize(10) MainWindow.setFont(font) icon = QtGui.QIcon() - icon.addPixmap(QtGui.QPixmap(":/res/ui/guiscrcpy_logo.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon.addPixmap(QtGui.QPixmap(":/res/ui/guiscrcpy_logo.png"), + QtGui.QIcon.Normal, QtGui.QIcon.Off) MainWindow.setWindowIcon(icon) MainWindow.setStyleSheet("QPushButton {\n" -"border-radius: 10px;\n" -" background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(0, 255, 255, 255), stop:1 rgba(0, 255, 152, 255));\n" -"color: rgb(0, 0, 0);\n" -"}\n" -"QPushButton:pressed {\n" -"border-radius: 10px;\n" -"background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(0, 255, 255, 255), stop:1 rgba(0, 255, 152, 255));\n" -"color: rgb(0, 0, 0);\n" -"}\n" -".QPushButton:hover {\n" -"border-radius: 10px;\n" -" background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(0, 199, 199, 255), stop:1 rgba(0, 190, 113, 255));\n" -"color: rgb(0, 0, 0);\n" -" }\n" -".QPushButton#quit{\n" -" background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:0, stop:0 rgba(255, 0, 0, 255), stop:1 rgba(255, 155, 0, 255));\n" -"color: rgb(0, 0, 0);\n" -"border-radius: 10px;\n" -" }\n" -".QPushButton#quit:hover{ \n" -" background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:0, stop:0 rgba(172, 0, 0, 255), stop:1 rgba(175, 106, 0, 255));\n" -"color: rgb(0, 0, 0);\n" -"border-radius: 10px;\n" -" }\n" -".QPushButton#usbaud{\n" -"background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(0, 0, 255, 255), stop:0.901961 rgba(152, 0, 255, 255));\n" -"color: rgb(0, 0, 0);\n" -"border-radius: 10px;\n" -"}\n" -".QPushButton#usbaud:hover{ \n" -" background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:0, stop:0 rgba(172, 0, 0, 255), stop:1 rgba(175, 106, 0, 255));\n" -"color: rgb(0, 0, 0);\n" -"border-radius: 10px;\n" -"}\n" -".QPushButton#mapnow{\n" -"background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:0, stop:0 rgba(253, 0, 255, 255), stop:0.990196 rgba(88, 0, 255, 255));\n" -"color: rgb(0, 0, 0);\n" -"border-radius: 10px;\n" -" }\n" -".QPushButton#mapnow{\n" -"background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:0, stop:0 rgba(199, 0, 255, 255), stop:0.990196 rgba(88, 0, 255, 255));\n" -"color: rgb(0, 0, 0);\n" -"border-radius: 10px;\n" -"}\n" -".QPushButton#network_button{\n" -"background-color: rgb(60, 60, 60);\n" -"color: rgb(0, 0, 0);\n" -"border-radius: 10px; \n" -" }\n" -"\n" -".QPushButton#settings_button{\n" -"background-color: rgb(60, 60, 60);\n" -"color: rgb(0, 0, 0);\n" -"border-radius: 10px; \n" -" }\n" -"\n" -"") + "border-radius: 10px;\n" + " background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(0, 255, 255, 255), stop:1 rgba(0, 255, 152, 255));\n" + "color: rgb(0, 0, 0);\n" + "}\n" + "QPushButton:pressed {\n" + "border-radius: 10px;\n" + "background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(0, 255, 255, 255), stop:1 rgba(0, 255, 152, 255));\n" + "color: rgb(0, 0, 0);\n" + "}\n" + ".QPushButton:hover {\n" + "border-radius: 10px;\n" + " background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(0, 199, 199, 255), stop:1 rgba(0, 190, 113, 255));\n" + "color: rgb(0, 0, 0);\n" + " }\n" + ".QPushButton#quit{\n" + " background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:0, stop:0 rgba(255, 0, 0, 255), stop:1 rgba(255, 155, 0, 255));\n" + "color: rgb(0, 0, 0);\n" + "border-radius: 10px;\n" + " }\n" + ".QPushButton#quit:hover{ \n" + " background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:0, stop:0 rgba(172, 0, 0, 255), stop:1 rgba(175, 106, 0, 255));\n" + "color: rgb(0, 0, 0);\n" + "border-radius: 10px;\n" + " }\n" + ".QPushButton#usbaud{\n" + "background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(0, 0, 255, 255), stop:0.901961 rgba(152, 0, 255, 255));\n" + "color: rgb(0, 0, 0);\n" + "border-radius: 10px;\n" + "}\n" + ".QPushButton#usbaud:hover{ \n" + " background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:0, stop:0 rgba(172, 0, 0, 255), stop:1 rgba(175, 106, 0, 255));\n" + "color: rgb(0, 0, 0);\n" + "border-radius: 10px;\n" + "}\n" + ".QPushButton#mapnow{\n" + "background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:0, stop:0 rgba(253, 0, 255, 255), stop:0.990196 rgba(88, 0, 255, 255));\n" + "color: rgb(0, 0, 0);\n" + "border-radius: 10px;\n" + " }\n" + ".QPushButton#mapnow{\n" + "background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:0, stop:0 rgba(199, 0, 255, 255), stop:0.990196 rgba(88, 0, 255, 255));\n" + "color: rgb(0, 0, 0);\n" + "border-radius: 10px;\n" + "}\n" + ".QPushButton#network_button{\n" + "background-color: rgb(60, 60, 60);\n" + "color: rgb(0, 0, 0);\n" + "border-radius: 10px; \n" + " }\n" + "\n" + ".QPushButton#settings_button{\n" + "background-color: rgb(60, 60, 60);\n" + "color: rgb(0, 0, 0);\n" + "border-radius: 10px; \n" + " }\n" + "\n" + "") MainWindow.setUnifiedTitleAndToolBarOnMac(False) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setEnabled(True) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(24) sizePolicy.setVerticalStretch(25) - sizePolicy.setHeightForWidth(self.centralwidget.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.centralwidget.sizePolicy().hasHeightForWidth()) self.centralwidget.setSizePolicy(sizePolicy) self.centralwidget.setMinimumSize(QtCore.QSize(500, 300)) self.centralwidget.setStyleSheet("") @@ -101,13 +107,16 @@ def setupUi(self, MainWindow): self.frame = QtWidgets.QFrame(self.centralwidget) self.frame.setObjectName("frame") self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.frame) - self.horizontalLayout_2.setSizeConstraint(QtWidgets.QLayout.SetMaximumSize) + self.horizontalLayout_2.setSizeConstraint( + QtWidgets.QLayout.SetMaximumSize) self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.label_4 = QtWidgets.QLabel(self.frame) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.label_4.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.label_4.sizePolicy().hasHeightForWidth()) self.label_4.setSizePolicy(sizePolicy) self.label_4.setMinimumSize(QtCore.QSize(60, 60)) self.label_4.setMaximumSize(QtCore.QSize(60, 60)) @@ -117,14 +126,17 @@ def setupUi(self, MainWindow): self.label_4.setObjectName("label_4") self.horizontalLayout_2.addWidget(self.label_4) self.verticalLayout_2 = QtWidgets.QVBoxLayout() - self.verticalLayout_2.setSizeConstraint(QtWidgets.QLayout.SetMaximumSize) + self.verticalLayout_2.setSizeConstraint( + QtWidgets.QLayout.SetMaximumSize) self.verticalLayout_2.setSpacing(0) self.verticalLayout_2.setObjectName("verticalLayout_2") self.label_3 = QtWidgets.QLabel(self.frame) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.label_3.sizePolicy().hasHeightForWidth()) self.label_3.setSizePolicy(sizePolicy) font = QtGui.QFont() font.setFamily("Titillium Web") @@ -137,10 +149,12 @@ def setupUi(self, MainWindow): self.label_3.setObjectName("label_3") self.verticalLayout_2.addWidget(self.label_3) self.build_label = QtWidgets.QLabel(self.frame) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Maximum) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Maximum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.build_label.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.build_label.sizePolicy().hasHeightForWidth()) self.build_label.setSizePolicy(sizePolicy) font = QtGui.QFont() font.setFamily("Titillium Web") @@ -151,10 +165,12 @@ def setupUi(self, MainWindow): self.horizontalLayout_2.addLayout(self.verticalLayout_2) self.gridLayout_5.addWidget(self.frame, 0, 0, 1, 1) self.frame1 = QtWidgets.QFrame(self.centralwidget) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.frame1.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.frame1.sizePolicy().hasHeightForWidth()) self.frame1.setSizePolicy(sizePolicy) self.frame1.setObjectName("frame1") self.verticalLayout = QtWidgets.QVBoxLayout(self.frame1) @@ -166,10 +182,12 @@ def setupUi(self, MainWindow): self.gridLayout_4.setVerticalSpacing(1) self.gridLayout_4.setObjectName("gridLayout_4") self.displayForceOn = QtWidgets.QCheckBox(self.frame1) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.displayForceOn.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.displayForceOn.sizePolicy().hasHeightForWidth()) self.displayForceOn.setSizePolicy(sizePolicy) self.displayForceOn.setMinimumSize(QtCore.QSize(10, 20)) font = QtGui.QFont() @@ -178,15 +196,18 @@ def setupUi(self, MainWindow): self.displayForceOn.setFont(font) self.displayForceOn.setToolTipDuration(2) icon1 = QtGui.QIcon() - icon1.addPixmap(QtGui.QPixmap(":/icons/icons/bullseye.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon1.addPixmap(QtGui.QPixmap(":/icons/icons/bullseye.svg"), + QtGui.QIcon.Normal, QtGui.QIcon.Off) self.displayForceOn.setIcon(icon1) self.displayForceOn.setObjectName("displayForceOn") self.gridLayout_4.addWidget(self.displayForceOn, 1, 0, 1, 3) self.showTouches = QtWidgets.QCheckBox(self.frame1) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.showTouches.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.showTouches.sizePolicy().hasHeightForWidth()) self.showTouches.setSizePolicy(sizePolicy) self.showTouches.setMinimumSize(QtCore.QSize(10, 20)) font = QtGui.QFont() @@ -194,28 +215,34 @@ def setupUi(self, MainWindow): font.setPointSize(10) self.showTouches.setFont(font) icon2 = QtGui.QIcon() - icon2.addPixmap(QtGui.QPixmap(":/icons/icons/hand-finger-pointing-down.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon2.addPixmap(QtGui.QPixmap( + ":/icons/icons/hand-finger-pointing-down.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.showTouches.setIcon(icon2) self.showTouches.setObjectName("showTouches") self.gridLayout_4.addWidget(self.showTouches, 0, 4, 1, 1) self.network_button = QtWidgets.QPushButton(self.frame1) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.network_button.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.network_button.sizePolicy().hasHeightForWidth()) self.network_button.setSizePolicy(sizePolicy) self.network_button.setToolTipDuration(2) self.network_button.setText("") icon3 = QtGui.QIcon() - icon3.addPixmap(QtGui.QPixmap(":/icons/icons/wifi.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon3.addPixmap(QtGui.QPixmap(":/icons/icons/wifi.svg"), + QtGui.QIcon.Normal, QtGui.QIcon.Off) self.network_button.setIcon(icon3) self.network_button.setObjectName("network_button") self.gridLayout_4.addWidget(self.network_button, 2, 0, 1, 1) self.notifChecker = QtWidgets.QCheckBox(self.frame1) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.notifChecker.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.notifChecker.sizePolicy().hasHeightForWidth()) self.notifChecker.setSizePolicy(sizePolicy) self.notifChecker.setMinimumSize(QtCore.QSize(10, 20)) font = QtGui.QFont() @@ -224,16 +251,19 @@ def setupUi(self, MainWindow): self.notifChecker.setFont(font) self.notifChecker.setToolTipDuration(2) icon4 = QtGui.QIcon() - icon4.addPixmap(QtGui.QPixmap(":/icons/icons/bell-musical-tool.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon4.addPixmap(QtGui.QPixmap( + ":/icons/icons/bell-musical-tool.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.notifChecker.setIcon(icon4) self.notifChecker.setObjectName("notifChecker") self.gridLayout_4.addWidget(self.notifChecker, 1, 3, 1, 1) self.recScui = QtWidgets.QCheckBox(self.frame1) self.recScui.setEnabled(True) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.recScui.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.recScui.sizePolicy().hasHeightForWidth()) self.recScui.setSizePolicy(sizePolicy) self.recScui.setMinimumSize(QtCore.QSize(10, 20)) font = QtGui.QFont() @@ -245,24 +275,29 @@ def setupUi(self, MainWindow): self.recScui.setFont(font) self.recScui.setToolTipDuration(2) icon5 = QtGui.QIcon() - icon5.addPixmap(QtGui.QPixmap(":/icons/icons/facetime-button.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon5.addPixmap(QtGui.QPixmap( + ":/icons/icons/facetime-button.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.recScui.setIcon(icon5) self.recScui.setObjectName("recScui") self.gridLayout_4.addWidget(self.recScui, 1, 4, 1, 1) self.runningNot = QtWidgets.QPushButton(self.frame1) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.runningNot.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.runningNot.sizePolicy().hasHeightForWidth()) self.runningNot.setSizePolicy(sizePolicy) self.runningNot.setText("") self.runningNot.setObjectName("runningNot") self.gridLayout_4.addWidget(self.runningNot, 2, 2, 1, 3) self.fullscreen = QtWidgets.QCheckBox(self.frame1) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.fullscreen.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.fullscreen.sizePolicy().hasHeightForWidth()) self.fullscreen.setSizePolicy(sizePolicy) self.fullscreen.setMinimumSize(QtCore.QSize(10, 20)) font = QtGui.QFont() @@ -270,15 +305,18 @@ def setupUi(self, MainWindow): font.setPointSize(10) self.fullscreen.setFont(font) icon6 = QtGui.QIcon() - icon6.addPixmap(QtGui.QPixmap(":/icons/icons/increase-size-option.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon6.addPixmap(QtGui.QPixmap( + ":/icons/icons/increase-size-option.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.fullscreen.setIcon(icon6) self.fullscreen.setObjectName("fullscreen") self.gridLayout_4.addWidget(self.fullscreen, 0, 3, 1, 1) self.aotop = QtWidgets.QCheckBox(self.frame1) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.aotop.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.aotop.sizePolicy().hasHeightForWidth()) self.aotop.setSizePolicy(sizePolicy) self.aotop.setMinimumSize(QtCore.QSize(10, 20)) font = QtGui.QFont() @@ -287,19 +325,23 @@ def setupUi(self, MainWindow): self.aotop.setFont(font) self.aotop.setToolTipDuration(2) icon7 = QtGui.QIcon() - icon7.addPixmap(QtGui.QPixmap(":/icons/icons/fire-symbol.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon7.addPixmap(QtGui.QPixmap(":/icons/icons/fire-symbol.svg"), + QtGui.QIcon.Normal, QtGui.QIcon.Off) self.aotop.setIcon(icon7) self.aotop.setObjectName("aotop") self.gridLayout_4.addWidget(self.aotop, 0, 0, 1, 3) self.settings_button = QtWidgets.QPushButton(self.frame1) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.settings_button.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.settings_button.sizePolicy().hasHeightForWidth()) self.settings_button.setSizePolicy(sizePolicy) self.settings_button.setText("") icon8 = QtGui.QIcon() - icon8.addPixmap(QtGui.QPixmap(":/icons/icons/gear.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon8.addPixmap(QtGui.QPixmap(":/icons/icons/gear.svg"), + QtGui.QIcon.Normal, QtGui.QIcon.Off) self.settings_button.setIcon(icon8) self.settings_button.setObjectName("settings_button") self.gridLayout_4.addWidget(self.settings_button, 2, 1, 1, 1) @@ -308,10 +350,12 @@ def setupUi(self, MainWindow): self.gridLayout_3.setSpacing(0) self.gridLayout_3.setObjectName("gridLayout_3") self.bitrateText = QtWidgets.QLabel(self.frame1) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.bitrateText.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.bitrateText.sizePolicy().hasHeightForWidth()) self.bitrateText.setSizePolicy(sizePolicy) font = QtGui.QFont() font.setFamily("Titillium Web") @@ -321,19 +365,21 @@ def setupUi(self, MainWindow): self.bitrateText.setFont(font) self.bitrateText.setStatusTip("") self.bitrateText.setStyleSheet("color: rgb(0, 0, 0);\n" -"border-radius: 10px;\n" -"\n" -"background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(0, 255, 255, 255), stop:1 rgba(0, 255, 0, 255));") + "border-radius: 10px;\n" + "\n" + "background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(0, 255, 255, 255), stop:1 rgba(0, 255, 0, 255));") self.bitrateText.setTextFormat(QtCore.Qt.AutoText) self.bitrateText.setAlignment(QtCore.Qt.AlignCenter) self.bitrateText.setObjectName("bitrateText") self.gridLayout_3.addWidget(self.bitrateText, 1, 1, 1, 1) self.dimensionSlider = QtWidgets.QSlider(self.frame1) self.dimensionSlider.setEnabled(False) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.dimensionSlider.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.dimensionSlider.sizePolicy().hasHeightForWidth()) self.dimensionSlider.setSizePolicy(sizePolicy) self.dimensionSlider.setStyleSheet("color: rgb(255, 255, 255);") self.dimensionSlider.setMinimum(320) @@ -343,10 +389,12 @@ def setupUi(self, MainWindow): self.dimensionSlider.setObjectName("dimensionSlider") self.gridLayout_3.addWidget(self.dimensionSlider, 2, 2, 1, 1) self.dial = QtWidgets.QDial(self.frame1) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.dial.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.dial.sizePolicy().hasHeightForWidth()) self.dial.setSizePolicy(sizePolicy) font = QtGui.QFont() font.setFamily("Trebuchet MS") @@ -355,11 +403,11 @@ def setupUi(self, MainWindow): self.dial.setCursor(QtGui.QCursor(QtCore.Qt.SizeHorCursor)) self.dial.setToolTipDuration(2) self.dial.setStyleSheet("background-color: rgb(0, 255, 255);\n" -"color: rgb(255, 0, 127);\n" -"gridline-color: rgb(255, 0, 0);\n" -"selection-background-color: rgb(12, 255, 0);\n" -"\n" -"image: url(:/res/ui/guiscrcpy_logo.png);") + "color: rgb(255, 0, 127);\n" + "gridline-color: rgb(255, 0, 0);\n" + "selection-background-color: rgb(12, 255, 0);\n" + "\n" + "image: url(:/res/ui/guiscrcpy_logo.png);") self.dial.setMinimum(64) self.dial.setMaximum(16000) self.dial.setSingleStep(2) @@ -373,10 +421,12 @@ def setupUi(self, MainWindow): self.dial.setObjectName("dial") self.gridLayout_3.addWidget(self.dial, 0, 0, 3, 1) self.label = QtWidgets.QLabel(self.frame1) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.label.sizePolicy().hasHeightForWidth()) self.label.setSizePolicy(sizePolicy) font = QtGui.QFont() font.setFamily("Trebuchet MS") @@ -385,10 +435,12 @@ def setupUi(self, MainWindow): self.label.setObjectName("label") self.gridLayout_3.addWidget(self.label, 0, 1, 1, 1) self.dimensionDefaultCheckbox = QtWidgets.QCheckBox(self.frame1) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.dimensionDefaultCheckbox.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.dimensionDefaultCheckbox.sizePolicy().hasHeightForWidth()) self.dimensionDefaultCheckbox.setSizePolicy(sizePolicy) font = QtGui.QFont() font.setFamily("Trebuchet MS") @@ -401,10 +453,12 @@ def setupUi(self, MainWindow): self.dimensionDefaultCheckbox.setObjectName("dimensionDefaultCheckbox") self.gridLayout_3.addWidget(self.dimensionDefaultCheckbox, 0, 2, 1, 1) self.dimensionText = QtWidgets.QLabel(self.frame1) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.dimensionText.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.dimensionText.sizePolicy().hasHeightForWidth()) self.dimensionText.setSizePolicy(sizePolicy) font = QtGui.QFont() font.setFamily("Titillium Web") @@ -415,19 +469,21 @@ def setupUi(self, MainWindow): self.dimensionText.setToolTipDuration(2) self.dimensionText.setStatusTip("") self.dimensionText.setStyleSheet("color: rgb(255, 255, 255);\n" -"background-color: rgb(17, 17, 17);\n" -"border-radius: 10px;\n" -"") + "background-color: rgb(17, 17, 17);\n" + "border-radius: 10px;\n" + "") self.dimensionText.setTextFormat(QtCore.Qt.AutoText) self.dimensionText.setAlignment(QtCore.Qt.AlignCenter) self.dimensionText.setObjectName("dimensionText") self.gridLayout_3.addWidget(self.dimensionText, 1, 2, 1, 1) self.verticalLayout.addLayout(self.gridLayout_3) self.flaglineedit = QtWidgets.QLineEdit(self.frame1) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Maximum) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Maximum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.flaglineedit.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.flaglineedit.sizePolicy().hasHeightForWidth()) self.flaglineedit.setSizePolicy(sizePolicy) font = QtGui.QFont() font.setFamily("Courier 10 Pitch") @@ -439,24 +495,29 @@ def setupUi(self, MainWindow): self.horizontalLayout.setSpacing(5) self.horizontalLayout.setObjectName("horizontalLayout") self.quit = QtWidgets.QPushButton(self.frame1) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Maximum) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Maximum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.quit.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.quit.sizePolicy().hasHeightForWidth()) self.quit.setSizePolicy(sizePolicy) self.quit.setMinimumSize(QtCore.QSize(45, 45)) self.quit.setStyleSheet("") self.quit.setText("") icon9 = QtGui.QIcon() - icon9.addPixmap(QtGui.QPixmap(":/icons/icons/cross-mark-on-a-black-circle-background.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon9.addPixmap(QtGui.QPixmap( + ":/icons/icons/cross-mark-on-a-black-circle-background.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.quit.setIcon(icon9) self.quit.setObjectName("quit") self.horizontalLayout.addWidget(self.quit) self.pushButton = QtWidgets.QPushButton(self.frame1) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.pushButton.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.pushButton.sizePolicy().hasHeightForWidth()) self.pushButton.setSizePolicy(sizePolicy) self.pushButton.setMinimumSize(QtCore.QSize(45, 45)) font = QtGui.QFont() @@ -468,65 +529,79 @@ def setupUi(self, MainWindow): self.pushButton.setObjectName("pushButton") self.horizontalLayout.addWidget(self.pushButton) self.abtgit = QtWidgets.QPushButton(self.frame1) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.abtgit.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.abtgit.sizePolicy().hasHeightForWidth()) self.abtgit.setSizePolicy(sizePolicy) self.abtgit.setMinimumSize(QtCore.QSize(45, 45)) self.abtgit.setText("") icon10 = QtGui.QIcon() - icon10.addPixmap(QtGui.QPixmap(":/icons/icons/github.logo.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon10.addPixmap(QtGui.QPixmap( + ":/icons/icons/github.logo.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.abtgit.setIcon(icon10) self.abtgit.setIconSize(QtCore.QSize(20, 20)) self.abtgit.setObjectName("abtgit") self.horizontalLayout.addWidget(self.abtgit) self.abtme = QtWidgets.QPushButton(self.frame1) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.abtme.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.abtme.sizePolicy().hasHeightForWidth()) self.abtme.setSizePolicy(sizePolicy) self.abtme.setMinimumSize(QtCore.QSize(33, 45)) self.abtme.setText("") icon11 = QtGui.QIcon() - icon11.addPixmap(QtGui.QPixmap(":/icons/icons/ss-branding.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon11.addPixmap(QtGui.QPixmap( + ":/icons/icons/ss-branding.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.abtme.setIcon(icon11) self.abtme.setIconSize(QtCore.QSize(20, 20)) self.abtme.setObjectName("abtme") self.horizontalLayout.addWidget(self.abtme) self.usbaud = QtWidgets.QPushButton(self.frame1) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum) sizePolicy.setHorizontalStretch(11) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.usbaud.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.usbaud.sizePolicy().hasHeightForWidth()) self.usbaud.setSizePolicy(sizePolicy) self.usbaud.setMinimumSize(QtCore.QSize(45, 45)) self.usbaud.setText("") icon12 = QtGui.QIcon() - icon12.addPixmap(QtGui.QPixmap(":/icons/icons/volume-up-interface-symbol.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon12.addPixmap(QtGui.QPixmap( + ":/icons/icons/volume-up-interface-symbol.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.usbaud.setIcon(icon12) self.usbaud.setObjectName("usbaud") self.horizontalLayout.addWidget(self.usbaud) self.mapnow = QtWidgets.QPushButton(self.frame1) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum) sizePolicy.setHorizontalStretch(11) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.mapnow.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.mapnow.sizePolicy().hasHeightForWidth()) self.mapnow.setSizePolicy(sizePolicy) self.mapnow.setMinimumSize(QtCore.QSize(45, 45)) self.mapnow.setToolTipDuration(3) self.mapnow.setText("") icon13 = QtGui.QIcon() - icon13.addPixmap(QtGui.QPixmap(":/icons/icons/four-black-squares.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon13.addPixmap(QtGui.QPixmap( + ":/icons/icons/four-black-squares.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.mapnow.setIcon(icon13) self.mapnow.setObjectName("mapnow") self.horizontalLayout.addWidget(self.mapnow) self.executeaction = QtWidgets.QPushButton(self.frame1) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Maximum) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Maximum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.executeaction.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.executeaction.sizePolicy().hasHeightForWidth()) self.executeaction.setSizePolicy(sizePolicy) self.executeaction.setMinimumSize(QtCore.QSize(45, 45)) font = QtGui.QFont() @@ -538,7 +613,8 @@ def setupUi(self, MainWindow): self.executeaction.setFont(font) self.executeaction.setStyleSheet("") icon14 = QtGui.QIcon() - icon14.addPixmap(QtGui.QPixmap(":/icons/icons/small-rocket-ship-silhouette.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon14.addPixmap(QtGui.QPixmap( + ":/icons/icons/small-rocket-ship-silhouette.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.executeaction.setIcon(icon14) self.executeaction.setIconSize(QtCore.QSize(20, 16)) self.executeaction.setObjectName("executeaction") @@ -548,7 +624,8 @@ def setupUi(self, MainWindow): palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) + palette.setBrush(QtGui.QPalette.Active, + QtGui.QPalette.WindowText, brush) gradient = QtGui.QLinearGradient(0.0, 0.0, 1.0, 0.0) gradient.setSpread(QtGui.QGradient.PadSpread) gradient.setCoordinateMode(QtGui.QGradient.ObjectBoundingMode) @@ -561,7 +638,8 @@ def setupUi(self, MainWindow): palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) + palette.setBrush(QtGui.QPalette.Active, + QtGui.QPalette.ButtonText, brush) gradient = QtGui.QLinearGradient(0.0, 0.0, 1.0, 0.0) gradient.setSpread(QtGui.QGradient.PadSpread) gradient.setCoordinateMode(QtGui.QGradient.ObjectBoundingMode) @@ -578,16 +656,20 @@ def setupUi(self, MainWindow): palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(85, 255, 0)) brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Highlight, brush) + palette.setBrush(QtGui.QPalette.Active, + QtGui.QPalette.Highlight, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.HighlightedText, brush) + palette.setBrush(QtGui.QPalette.Active, + QtGui.QPalette.HighlightedText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255, 128)) brush.setStyle(QtCore.Qt.NoBrush) - palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.PlaceholderText, brush) + palette.setBrush(QtGui.QPalette.Active, + QtGui.QPalette.PlaceholderText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) + palette.setBrush(QtGui.QPalette.Inactive, + QtGui.QPalette.WindowText, brush) gradient = QtGui.QLinearGradient(0.0, 0.0, 1.0, 0.0) gradient.setSpread(QtGui.QGradient.PadSpread) gradient.setCoordinateMode(QtGui.QGradient.ObjectBoundingMode) @@ -600,7 +682,8 @@ def setupUi(self, MainWindow): palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) + palette.setBrush(QtGui.QPalette.Inactive, + QtGui.QPalette.ButtonText, brush) gradient = QtGui.QLinearGradient(0.0, 0.0, 1.0, 0.0) gradient.setSpread(QtGui.QGradient.PadSpread) gradient.setCoordinateMode(QtGui.QGradient.ObjectBoundingMode) @@ -617,16 +700,20 @@ def setupUi(self, MainWindow): palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(85, 255, 0)) brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Highlight, brush) + palette.setBrush(QtGui.QPalette.Inactive, + QtGui.QPalette.Highlight, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.HighlightedText, brush) + palette.setBrush(QtGui.QPalette.Inactive, + QtGui.QPalette.HighlightedText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255, 128)) brush.setStyle(QtCore.Qt.NoBrush) - palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.PlaceholderText, brush) + palette.setBrush(QtGui.QPalette.Inactive, + QtGui.QPalette.PlaceholderText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) + palette.setBrush(QtGui.QPalette.Disabled, + QtGui.QPalette.WindowText, brush) gradient = QtGui.QLinearGradient(0.0, 0.0, 1.0, 0.0) gradient.setSpread(QtGui.QGradient.PadSpread) gradient.setCoordinateMode(QtGui.QGradient.ObjectBoundingMode) @@ -639,7 +726,8 @@ def setupUi(self, MainWindow): palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) + palette.setBrush(QtGui.QPalette.Disabled, + QtGui.QPalette.ButtonText, brush) gradient = QtGui.QLinearGradient(0.0, 0.0, 1.0, 0.0) gradient.setSpread(QtGui.QGradient.PadSpread) gradient.setCoordinateMode(QtGui.QGradient.ObjectBoundingMode) @@ -656,23 +744,26 @@ def setupUi(self, MainWindow): palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(85, 255, 0)) brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Highlight, brush) + palette.setBrush(QtGui.QPalette.Disabled, + QtGui.QPalette.Highlight, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.HighlightedText, brush) + palette.setBrush(QtGui.QPalette.Disabled, + QtGui.QPalette.HighlightedText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255, 128)) brush.setStyle(QtCore.Qt.NoBrush) - palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.PlaceholderText, brush) + palette.setBrush(QtGui.QPalette.Disabled, + QtGui.QPalette.PlaceholderText, brush) self.progressBar.setPalette(palette) font = QtGui.QFont() font.setFamily("Trebuchet MS") font.setPointSize(10) self.progressBar.setFont(font) self.progressBar.setStyleSheet("background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(0, 255, 255, 255), stop:1 rgba(0, 255, 0, 255));\n" -"color: rgb(255,255,255);\n" -"selection-color: rgb(255, 255, 255);\n" -"selection-background-color: rgb(38, 255, 0);\n" -"selection-background-color: rgb(85, 255, 0);") + "color: rgb(255,255,255);\n" + "selection-color: rgb(255, 255, 255);\n" + "selection-background-color: rgb(38, 255, 0);\n" + "selection-background-color: rgb(85, 255, 0);") self.progressBar.setProperty("value", 100) self.progressBar.setObjectName("progressBar") self.verticalLayout.addWidget(self.progressBar) @@ -693,44 +784,59 @@ def retranslateUi(self, MainWindow): _translate = QtCore.QCoreApplication.translate MainWindow.setWindowTitle(_translate("MainWindow", "guiscrcpy")) MainWindow.setStatusTip(_translate("MainWindow", "GUI by srevinsaju, scrcpy engine by rom1v. Hosted on GitHub\n" -" https://github.com/srevinsaju/guiscrcpy\n" -" ")) + " https://github.com/srevinsaju/guiscrcpy\n" + " ")) self.label_4.setToolTip(_translate("MainWindow", "GUI by srevinsaju, scrcpy engine by rom1v. Hosted on GitHub\n" -" https://github.com/srevinsaju/guiscrcpy\n" -" ")) + " https://github.com/srevinsaju/guiscrcpy\n" + " ")) self.label_4.setStatusTip(_translate("MainWindow", "GUI by srevinsaju, scrcpy engine by rom1v. Hosted on GitHub\n" -" https://github.com/srevinsaju/guiscrcpy\n" -" ")) + " https://github.com/srevinsaju/guiscrcpy\n" + " ")) self.label_3.setStatusTip(_translate("MainWindow", "GUI by srevinsaju, scrcpy engine by rom1v. Hosted on GitHub\n" -" https://github.com/srevinsaju/guiscrcpy\n" -" ")) - self.label_3.setText(_translate("MainWindow", "guiscrcpy ")) + " https://github.com/srevinsaju/guiscrcpy\n" + " ")) + self.label_3.setText(_translate( + "MainWindow", "guiscrcpy ")) self.build_label.setText(_translate("MainWindow", "Build")) - self.displayForceOn.setToolTip(_translate("MainWindow", "Use your computer screen as your android device\'s HD Display")) - self.displayForceOn.setText(_translate("MainWindow", "Keep display off ")) + self.displayForceOn.setToolTip(_translate( + "MainWindow", "Use your computer screen as your android device\'s HD Display")) + self.displayForceOn.setText(_translate( + "MainWindow", "Keep display off ")) self.showTouches.setText(_translate("MainWindow", "Show touches")) - self.network_button.setToolTip(_translate("MainWindow", "Launch Network Manager")) - self.notifChecker.setToolTip(_translate("MainWindow", "Make guiscrcpy check for new notifications on your device. A status bar icon indicating new notifications will be visible. (Experimental)")) - self.notifChecker.setText(_translate("MainWindow", "Notification Auditor")) - self.recScui.setToolTip(_translate("MainWindow", "Record your screen mirroring to your home directory. In Linux, it is in ~guiscrcpy directory. In Windows, it is in C:Users with the date in seconds, followed by .mp4")) + self.network_button.setToolTip(_translate( + "MainWindow", "Launch Network Manager")) + self.notifChecker.setToolTip(_translate( + "MainWindow", "Make guiscrcpy check for new notifications on your device. A status bar icon indicating new notifications will be visible. (Experimental)")) + self.notifChecker.setText(_translate( + "MainWindow", "Notification Auditor")) + self.recScui.setToolTip(_translate( + "MainWindow", "Record your screen mirroring to your home directory. In Linux, it is in ~guiscrcpy directory. In Windows, it is in C:Users with the date in seconds, followed by .mp4")) self.recScui.setStatusTip(_translate("MainWindow", "See tooltip")) self.recScui.setText(_translate("MainWindow", "Record screen")) self.fullscreen.setText(_translate("MainWindow", "Fullscreen")) - self.aotop.setToolTip(_translate("MainWindow", "Keep display always on top of other windows")) + self.aotop.setToolTip(_translate( + "MainWindow", "Keep display always on top of other windows")) self.aotop.setText(_translate("MainWindow", "Always on Top")) self.bitrateText.setText(_translate("MainWindow", "8000 KB/s")) - self.dial.setToolTip(_translate("MainWindow", "Changing the bitrate of the screen mirrorring. Useful to show playback at normal speed without lags")) - self.dial.setStatusTip(_translate("MainWindow", "Adjust Bitrate. Leave it untouched for defualts")) + self.dial.setToolTip(_translate( + "MainWindow", "Changing the bitrate of the screen mirrorring. Useful to show playback at normal speed without lags")) + self.dial.setStatusTip(_translate( + "MainWindow", "Adjust Bitrate. Leave it untouched for defualts")) self.label.setText(_translate("MainWindow", "Bitrate")) - self.dimensionDefaultCheckbox.setText(_translate("MainWindow", "Keep Default Dimensions")) - self.dimensionText.setToolTip(_translate("MainWindow", "Change device dimensions. scrcpy has some rendering problems upon changing dimensions")) + self.dimensionDefaultCheckbox.setText( + _translate("MainWindow", "Keep Default Dimensions")) + self.dimensionText.setToolTip(_translate( + "MainWindow", "Change device dimensions. scrcpy has some rendering problems upon changing dimensions")) self.dimensionText.setText(_translate("MainWindow", "DEFAULT")) - self.flaglineedit.setPlaceholderText(_translate("MainWindow", "Enter additional flags to pass to scrcpy")) + self.flaglineedit.setPlaceholderText(_translate( + "MainWindow", "Enter additional flags to pass to scrcpy")) self.quit.setStatusTip(_translate("MainWindow", "quit GUI")) self.pushButton.setText(_translate("MainWindow", " RESET ")) - self.mapnow.setToolTip(_translate("MainWindow", "Device Point to Key mapping launcher. Click to register keys for the first time. For the subsequent launches, the button will start key listeners")) - self.mapnow.setStatusTip(_translate("MainWindow", "Device Point to Key mapping launcher. Click to register keys for the first time. For the subsequent launches, the button will start key listeners")) - self.executeaction.setStatusTip(_translate("MainWindow", "Start Scrcpy Executable right now. Please check if Scrcpy is added to path")) + self.mapnow.setToolTip(_translate( + "MainWindow", "Device Point to Key mapping launcher. Click to register keys for the first time. For the subsequent launches, the button will start key listeners")) + self.mapnow.setStatusTip(_translate( + "MainWindow", "Device Point to Key mapping launcher. Click to register keys for the first time. For the subsequent launches, the button will start key listeners")) + self.executeaction.setStatusTip(_translate( + "MainWindow", "Start Scrcpy Executable right now. Please check if Scrcpy is added to path")) self.executeaction.setText(_translate("MainWindow", "START SCRCPY")) self.progressBar.setStatusTip(_translate("MainWindow", "Progress Bar")) -from . import rsrc_rc diff --git a/guiscrcpy/ui/network.py b/guiscrcpy/ui/network.py index dcc0df96..12a596a1 100644 --- a/guiscrcpy/ui/network.py +++ b/guiscrcpy/ui/network.py @@ -66,10 +66,12 @@ def retranslateUi(self, NetworkUI): _translate = QtCore.QCoreApplication.translate NetworkUI.setWindowTitle(_translate("NetworkUI", "Network Manager")) self.label.setText(_translate("NetworkUI", "List of Network Devices")) - self.nm_refresh.setStatusTip(_translate("NetworkUI", "Refresh Devices list")) + self.nm_refresh.setStatusTip(_translate( + "NetworkUI", "Refresh Devices list")) self.nm_refresh.setText(_translate("NetworkUI", "REFRESH")) self.spinBox.setToolTip(_translate("NetworkUI", "Port number")) self.spinBox.setStatusTip(_translate("NetworkUI", "Port number")) - self.nm_connect.setStatusTip(_translate("NetworkUI", "Establish connection")) + self.nm_connect.setStatusTip(_translate( + "NetworkUI", "Establish connection")) self.nm_connect.setText(_translate("NetworkUI", "CONNECT")) self.tcpip.setText(_translate("NetworkUI", "TCPIP")) diff --git a/guiscrcpy/ui/rsrc_rc.py b/guiscrcpy/ui/rsrc_rc.py index 7fffb86f..2c07d818 100644 --- a/guiscrcpy/ui/rsrc_rc.py +++ b/guiscrcpy/ui/rsrc_rc.py @@ -23622,10 +23622,15 @@ rcc_version = 2 qt_resource_struct = qt_resource_struct_v2 + def qInitResources(): - QtCore.qRegisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data) + QtCore.qRegisterResourceData( + rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data) + def qCleanupResources(): - QtCore.qUnregisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data) + QtCore.qUnregisterResourceData( + rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data) + qInitResources() diff --git a/guiscrcpy/ui/toolkit.py b/guiscrcpy/ui/toolkit.py index 427dd93f..7905cee4 100644 --- a/guiscrcpy/ui/toolkit.py +++ b/guiscrcpy/ui/toolkit.py @@ -474,5 +474,5 @@ def retranslateUi(self, ToolbarPanel): "ToolbarPanel", "Pinch out in the screen")) self.potraitUI.setToolTip(_translate("ToolbarPanel", "Potrait")) self.landscapeUI.setToolTip(_translate("ToolbarPanel", "Landscape")) - self.label.setText(_translate("ToolbarPanel", "....")) - self.label_2.setText(_translate("ToolbarPanel", "....")) + self.label.setText(_translate("ToolbarPanel", "::::")) + self.label_2.setText(_translate("ToolbarPanel", "::::")) diff --git a/guiscrcpy/ux/initializer.py b/guiscrcpy/ux/initializer.py new file mode 100644 index 00000000..f51cc373 --- /dev/null +++ b/guiscrcpy/ux/initializer.py @@ -0,0 +1,59 @@ +""" +GUISCRCPY by srevinsaju +Get it on : https://github.com/srevinsaju/guiscrcpy +Licensed under GNU Public License + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +""" + +from PyQt5 import QtCore +from PyQt5.QtCore import QPoint +from PyQt5.QtWidgets import QMainWindow + +from guiscrcpy.lib.toolkit import UXMapper +from guiscrcpy.ui.panel import Ui_HorizontalPanel + + +class Panel(QMainWindow, Ui_HorizontalPanel): + # there was a Dialog in the bracket + def __init__(self): + QMainWindow.__init__(self) + Ui_HorizontalPanel.__init__(self) + self.setupUi(self) + self.oldpos = self.pos() + self.setWindowFlags( + QtCore.Qt.WindowStaysOnTopHint | QtCore.Qt.FramelessWindowHint + ) + + def init(self): + self.ux = UXMapper() + self.backk.clicked.connect(self.ux.key_back) + self.menuUII.clicked.connect(self.ux.key_menu) + self.homee.clicked.connect(self.ux.key_home) + self.powerUII.clicked.connect(self.ux.key_power) + self.vupp.clicked.connect(self.ux.key_volume_up) + self.vdownn.clicked.connect(self.ux.key_volume_down) + self.show() + + def mousePressEvent(self, event): + self.oldPos = event.globalPos() + + def mouseMoveEvent(self, event): + try: + delta = QPoint(event.globalPos() - self.oldPos) + + self.move(self.x() + delta.x(), self.y() + delta.y()) + self.oldPos = event.globalPos() + except (TypeError, AttributeError): + pass diff --git a/guiscrcpy/ux/network.py b/guiscrcpy/ux/network.py index 6f8abe52..78b4873e 100644 --- a/guiscrcpy/ux/network.py +++ b/guiscrcpy/ux/network.py @@ -56,7 +56,8 @@ def connect(self): count += 1 readout = sp.stdout.readline().decode() if 'failed' in readout: - self.nm_det.setText('Device failed to get connected (is it an Android dev?') + self.nm_det.setText( + 'Device failed to get connected (is it an Android dev?') return if 'connected' in readout: print(readout) @@ -65,7 +66,8 @@ def connect(self): self.nm_det.setText('Device connect failed: Timeout') else: time.sleep(1) - self.nm_det.setText("Connected to IP:{}:{}".format(ip, self.spinBox.value())) + self.nm_det.setText( + "Connected to IP:{}:{}".format(ip, self.spinBox.value())) def refresh(self): self.listView.clear() diff --git a/io.srevinsaju.guiscrcpy.yml b/io.srevinsaju.guiscrcpy.yml index 1ee16cb8..d03ba503 100644 --- a/io.srevinsaju.guiscrcpy.yml +++ b/io.srevinsaju.guiscrcpy.yml @@ -29,4 +29,4 @@ script: - StartupWMClass=guiscrcpy - EOF - cp usr/share/applications/io.srevinsaju.guiscrcpy.desktop . - - usr/bin/pip3 freeze | grep "mu-editor" | cut -d "=" -f 3 >> ../VERSION \ No newline at end of file + - usr/bin/pip3 freeze | grep "guiscrcpy" | cut -d "=" -f 3 >> ../VERSION diff --git a/manifest.json b/manifest.json index 43e4bb9c..8f6e917f 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name": "guiscrcpy", - "version": "3.3", + "version": "3.5", "manifest_version": 2, "description": "Open Source Android Screen Mirroring System", @@ -10,7 +10,7 @@ "128": "/docs/img/guiscrcpy_logo.png" }, "browser_action": { - "default_title": "Guiscrcpy", + "default_title": "guiscrcpy", "default_icon": "/docs/img/guiscrcpy_logo.png" }, } diff --git a/requirements.txt b/requirements.txt old mode 100755 new mode 100644 index f38d8825..5fcc2ecd --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +fontTools GitPython==3.1.0 PyQt5>=5.14 diff --git a/screen.png b/screen.png old mode 100755 new mode 100644 diff --git a/screen2.png b/screen2.png old mode 100755 new mode 100644 diff --git a/setup.py b/setup.py index 4ee97c36..c297fbd3 100755 --- a/setup.py +++ b/setup.py @@ -1,15 +1,20 @@ +import platform + from setuptools import setup -import sys -import os from os import path this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: long_description = f.read() + def gen_version(): + """ + Generates a version from the avaailable git repositories + If git repository is not valid, fallback to __version__ + :return: + """ import git - repo = git.Repo(search_parent_directories=True) sha = repo.head.object.hexsha ver = repo.git.describe("--tags") @@ -19,23 +24,34 @@ def gen_version(): v = "{}".format(raw_version[0]) elif len(raw_version) == 2: # Release Candidate - v = "{major}.post{minor}".format(major=raw_version[0], minor=raw_version[1]) + v = "{major}.post{minor}".format( + major=raw_version[0], minor=raw_version[1]) else: # Revision Dev - v = "{major}.post{minor}.dev".format(major=raw_version[0], minor=raw_version[1]) + v = "{major}.post{minor}.dev".format( + major=raw_version[0], minor=raw_version[1]) return v + try: v = gen_version() except Exception as e: print("WARNING: {}".format(e)) - v = "3.3.x.src.dev" + v = "3.5.x.src.dev" + + +requirements = ['PyQt5==5.14.1', 'pynput', 'gitpython'] +if platform.system() == 'Windows': + requirements.extend(['pywin32', 'psutil']) +elif platform.system() == 'Linux': + requirements.extend(['fonttools', 'psutil']) + setup( name='guiscrcpy', version="{}".format(v), - description='An Open Source - Fast - Android Screen Mirroring system.', + description='An Open Source - Fast - Android Screen Mirroring system.', long_description=long_description, long_description_content_type='text/markdown', license='GPL v3', @@ -44,11 +60,12 @@ def gen_version(): packages=['guiscrcpy'], url="https://srevinsaju.github.io/guiscrcpy", download_url="https://github.com/srevinsaju/guiscrcpy/archive/master.zip", - package_data={'guiscrcpy': ['*', '*.*', 'resources/*', 'ui/*', 'lib/*', 'platform/*', 'theme/*', 'ux/*', 'network/*', 'settings/*'], + package_data={'guiscrcpy': ['*', '*.*', 'resources/*', 'ui/*', 'lib/*', 'platform/*', + 'theme/*', 'ux/*', 'network/*', 'settings/*', 'install/*', 'platform/windows_tools/*', 'ui/icons/*', 'ui/fonts/*', 'ui/rsrc/*', 'ui/ui/*'], '.': [".git/info/*"] }, include_package_data=True, - install_requires=['PyQt5==5.14.1', 'psutil', 'pynput', 'gitpython'], + install_requires=requirements, scripts=["scripts/guiscrcpy", "scripts/guiscrcpy-mapper"], entry_points={ 'console_scripts': [ diff --git a/version.txt b/version.txt index de2dec07..b837f87b 100644 --- a/version.txt +++ b/version.txt @@ -1,28 +1,29 @@ -VSVersionInfo( - ffi=FixedFileInfo( - filevers=(6, 1, 7601, 17514), - prodvers=(6, 1, 7601, 17514), - mask=0x3f, - flags=0x0, - OS=0x40004, - fileType=0x1, - subtype=0x0, - date=(0, 0) - ), - kids=[ - StringFileInfo( - [ - StringTable( - u'040904B0', - [StringStruct(u'CompanyName', u'Srevin Saju'), - StringStruct(u'FileDescription', u'guiscrcpy: Open Source Android Screen Mirroring System'), - StringStruct(u'FileVersion', u'3.3'), - StringStruct(u'InternalName', u'guiscrcpy'), - StringStruct(u'LegalCopyright', u'\xa9 Srevin Saju. (c) under GNU GPL v3.'), - StringStruct(u'OriginalFilename', u'guiscrcpy.exe'), - StringStruct(u'ProductName', u'guiscrcpy'), - StringStruct(u'ProductVersion', u'3.3')]) - ]), - VarFileInfo([VarStruct(u'Translation', [1033, 1200])]) - ] -) +VSVersionInfo( + ffi=FixedFileInfo( + filevers=(6, 1, 7601, 17514), + prodvers=(6, 1, 7601, 17514), + mask=0x3f, + flags=0x0, + OS=0x40004, + fileType=0x1, + subtype=0x0, + date=(0, 0) + ), + kids=[ + StringFileInfo( + [ + StringTable( + u'040904B0', + [StringStruct(u'CompanyName', u'Srevin Saju'), + StringStruct(u'FileDescription', u'guiscrcpy: Open Source Android Screen Mirroring System'), + StringStruct(u'FileVersion', u'3.5'), + StringStruct(u'InternalName', u'guiscrcpy'), + StringStruct(u'LegalCopyright', u'\xa9 Srevin Saju. (c) under GNU GPL v3.'), + StringStruct(u'OriginalFilename', u'guiscrcpy.exe'), + StringStruct(u'ProductName', u'guiscrcpy'), + StringStruct(u'ProductVersion', u'3.5')]) + ]), + VarFileInfo([VarStruct(u'Translation', [1033, 1200])]) + ] +) +