This repository has been archived by the owner on Dec 29, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Init downloader * Add init UI * Edit Object name of Initializer * Add support for selecting scrcpy executable * Fix Toolbar appearance (panel holder)
- Loading branch information
1 parent
77c3b6b
commit 66b92af
Showing
9 changed files
with
266 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# -*- 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 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")) | ||
from . import rsrc_rc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>Initializer</class> | ||
<widget class="QDialog" name="Initializer"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>222</width> | ||
<height>320</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Initializing</string> | ||
</property> | ||
<property name="windowIcon"> | ||
<iconset resource="rsrc.qrc"> | ||
<normaloff>:/res/ui/guiscrcpy_logo.png</normaloff>:/res/ui/guiscrcpy_logo.png</iconset> | ||
</property> | ||
<widget class="QWidget" name=""> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>221</width> | ||
<height>311</height> | ||
</rect> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<widget class="QLabel" name="label_2"> | ||
<property name="text"> | ||
<string/> | ||
</property> | ||
<property name="textFormat"> | ||
<enum>Qt::PlainText</enum> | ||
</property> | ||
<property name="pixmap"> | ||
<pixmap resource="rsrc.qrc">:/res/ui/guiscrcpy_logo.png</pixmap> | ||
</property> | ||
<property name="scaledContents"> | ||
<bool>true</bool> | ||
</property> | ||
<property name="alignment"> | ||
<set>Qt::AlignCenter</set> | ||
</property> | ||
<property name="wordWrap"> | ||
<bool>true</bool> | ||
</property> | ||
<property name="margin"> | ||
<number>15</number> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QLabel" name="stat"> | ||
<property name="font"> | ||
<font> | ||
<family>Titillium Web</family> | ||
<pointsize>30</pointsize> | ||
<weight>75</weight> | ||
<bold>true</bold> | ||
</font> | ||
</property> | ||
<property name="text"> | ||
<string>guiscrcpy</string> | ||
</property> | ||
<property name="scaledContents"> | ||
<bool>false</bool> | ||
</property> | ||
<property name="alignment"> | ||
<set>Qt::AlignCenter</set> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QLabel" name="label_3"> | ||
<property name="text"> | ||
<string>Initializing</string> | ||
</property> | ||
<property name="alignment"> | ||
<set>Qt::AlignCenter</set> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
</widget> | ||
<resources> | ||
<include location="rsrc.qrc"/> | ||
</resources> | ||
<connections/> | ||
</ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <https://www.gnu.org/licenses/>. | ||
""" | ||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters