mirror of
https://github.com/283375/arcaea-offline-pyside-ui.git
synced 2025-04-16 07:40:18 +00:00
impr: TabAbout
version info
This commit is contained in:
parent
d29104744d
commit
0f53cb8d5b
2
.gitignore
vendored
2
.gitignore
vendored
@ -4,6 +4,8 @@ __debug*
|
||||
arcaea_offline.db
|
||||
arcaea_offline.ini
|
||||
|
||||
ui/resources/VERSION
|
||||
|
||||
# Qt compiled stuff
|
||||
*.qm
|
||||
*_rc.py
|
||||
|
54
prebuild.py
Normal file
54
prebuild.py
Normal file
@ -0,0 +1,54 @@
|
||||
import os
|
||||
from importlib import metadata
|
||||
from pathlib import Path
|
||||
|
||||
# fill VERSION file
|
||||
versionFile = Path("ui/resources/VERSION")
|
||||
assert versionFile.exists()
|
||||
|
||||
# detect pip
|
||||
pipName = None
|
||||
possiblePipNames = ["pip3", "pip"]
|
||||
for possiblePipName in possiblePipNames:
|
||||
result = os.popen(possiblePipName).read()
|
||||
if (
|
||||
"<command> [options]" in result
|
||||
and "install" in result
|
||||
and "--upgrade" in result
|
||||
):
|
||||
pipName = possiblePipName
|
||||
break
|
||||
|
||||
versionTexts = []
|
||||
|
||||
# if possiblePipName:
|
||||
# pipFreezeLines = os.popen(f"{possiblePipName} freeze").read().split("\n")
|
||||
# text = [
|
||||
# pipFreezeResult
|
||||
# for pipFreezeResult in pipFreezeLines
|
||||
# if (
|
||||
# "arcaea-offline" in pipFreezeResult
|
||||
# or "PySide6" in pipFreezeResult
|
||||
# or "exif" in pipFreezeResult
|
||||
# or "opencv-python" in pipFreezeResult
|
||||
# or "SQLAlchemy" in pipFreezeResult
|
||||
# )
|
||||
# ]
|
||||
# versionTexts.append("\n".join(text))
|
||||
|
||||
importLibTexts = [
|
||||
f"{module}=={metadata.version(module)}"
|
||||
for module in [
|
||||
"arcaea-offline",
|
||||
"arcaea-offline-ocr",
|
||||
"exif",
|
||||
"opencv-python",
|
||||
"PySide6",
|
||||
"SQLAlchemy",
|
||||
"SQLAlchemy-Utils",
|
||||
]
|
||||
]
|
||||
versionTexts.append("\n".join(importLibTexts))
|
||||
|
||||
with versionFile.open("w", encoding="utf-8") as vf:
|
||||
vf.write("\n".join(versionTexts))
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>587</width>
|
||||
<height>431</height>
|
||||
<width>550</width>
|
||||
<height>400</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -80,6 +80,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="versionInfoButton">
|
||||
<property name="text">
|
||||
<string>Version Info</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
|
@ -1,87 +1,93 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file 'tabAbout.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.5.0
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QHBoxLayout, QLabel, QPushButton,
|
||||
QSizePolicy, QSpacerItem, QVBoxLayout, QWidget)
|
||||
|
||||
class Ui_TabAbout(object):
|
||||
def setupUi(self, TabAbout):
|
||||
if not TabAbout.objectName():
|
||||
TabAbout.setObjectName(u"TabAbout")
|
||||
TabAbout.resize(587, 431)
|
||||
TabAbout.setWindowTitle(u"TabAbout")
|
||||
self.verticalLayout = QVBoxLayout(TabAbout)
|
||||
self.verticalLayout.setObjectName(u"verticalLayout")
|
||||
self.logoLabel = QLabel(TabAbout)
|
||||
self.logoLabel.setObjectName(u"logoLabel")
|
||||
sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.logoLabel.sizePolicy().hasHeightForWidth())
|
||||
self.logoLabel.setSizePolicy(sizePolicy)
|
||||
self.logoLabel.setText(u"")
|
||||
self.logoLabel.setAlignment(Qt.AlignCenter)
|
||||
|
||||
self.verticalLayout.addWidget(self.logoLabel)
|
||||
|
||||
self.label = QLabel(TabAbout)
|
||||
self.label.setObjectName(u"label")
|
||||
font = QFont()
|
||||
font.setPointSize(14)
|
||||
self.label.setFont(font)
|
||||
self.label.setText(u"arcaea-offline-pyside-ui")
|
||||
self.label.setAlignment(Qt.AlignBottom|Qt.AlignHCenter)
|
||||
|
||||
self.verticalLayout.addWidget(self.label)
|
||||
|
||||
self.label_2 = QLabel(TabAbout)
|
||||
self.label_2.setObjectName(u"label_2")
|
||||
self.label_2.setText(u"A part of <a href=\"https://github.com/283375/arcaea-offline\">arcaea-offline project</a>")
|
||||
self.label_2.setAlignment(Qt.AlignHCenter|Qt.AlignTop)
|
||||
self.label_2.setOpenExternalLinks(True)
|
||||
|
||||
self.verticalLayout.addWidget(self.label_2)
|
||||
|
||||
self.horizontalLayout = QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName(u"horizontalLayout")
|
||||
self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
|
||||
|
||||
self.horizontalLayout.addItem(self.horizontalSpacer)
|
||||
|
||||
self.aboutQtButton = QPushButton(TabAbout)
|
||||
self.aboutQtButton.setObjectName(u"aboutQtButton")
|
||||
|
||||
self.horizontalLayout.addWidget(self.aboutQtButton)
|
||||
|
||||
self.horizontalSpacer_2 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
|
||||
|
||||
self.horizontalLayout.addItem(self.horizontalSpacer_2)
|
||||
|
||||
|
||||
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||
|
||||
|
||||
self.retranslateUi(TabAbout)
|
||||
|
||||
QMetaObject.connectSlotsByName(TabAbout)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, TabAbout):
|
||||
self.aboutQtButton.setText(QCoreApplication.translate("TabAbout", u"About Qt", None))
|
||||
pass
|
||||
# retranslateUi
|
||||
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file 'tabAbout.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.5.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QHBoxLayout, QLabel, QPushButton,
|
||||
QSizePolicy, QSpacerItem, QVBoxLayout, QWidget)
|
||||
|
||||
class Ui_TabAbout(object):
|
||||
def setupUi(self, TabAbout):
|
||||
if not TabAbout.objectName():
|
||||
TabAbout.setObjectName(u"TabAbout")
|
||||
TabAbout.resize(550, 400)
|
||||
TabAbout.setWindowTitle(u"TabAbout")
|
||||
self.verticalLayout = QVBoxLayout(TabAbout)
|
||||
self.verticalLayout.setObjectName(u"verticalLayout")
|
||||
self.logoLabel = QLabel(TabAbout)
|
||||
self.logoLabel.setObjectName(u"logoLabel")
|
||||
sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.logoLabel.sizePolicy().hasHeightForWidth())
|
||||
self.logoLabel.setSizePolicy(sizePolicy)
|
||||
self.logoLabel.setText(u"")
|
||||
self.logoLabel.setAlignment(Qt.AlignCenter)
|
||||
|
||||
self.verticalLayout.addWidget(self.logoLabel)
|
||||
|
||||
self.label = QLabel(TabAbout)
|
||||
self.label.setObjectName(u"label")
|
||||
font = QFont()
|
||||
font.setPointSize(14)
|
||||
self.label.setFont(font)
|
||||
self.label.setText(u"arcaea-offline-pyside-ui")
|
||||
self.label.setAlignment(Qt.AlignBottom|Qt.AlignHCenter)
|
||||
|
||||
self.verticalLayout.addWidget(self.label)
|
||||
|
||||
self.label_2 = QLabel(TabAbout)
|
||||
self.label_2.setObjectName(u"label_2")
|
||||
self.label_2.setText(u"A part of <a href=\"https://github.com/283375/arcaea-offline\">arcaea-offline project</a>")
|
||||
self.label_2.setAlignment(Qt.AlignHCenter|Qt.AlignTop)
|
||||
self.label_2.setOpenExternalLinks(True)
|
||||
|
||||
self.verticalLayout.addWidget(self.label_2)
|
||||
|
||||
self.horizontalLayout = QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName(u"horizontalLayout")
|
||||
self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
|
||||
|
||||
self.horizontalLayout.addItem(self.horizontalSpacer)
|
||||
|
||||
self.aboutQtButton = QPushButton(TabAbout)
|
||||
self.aboutQtButton.setObjectName(u"aboutQtButton")
|
||||
|
||||
self.horizontalLayout.addWidget(self.aboutQtButton)
|
||||
|
||||
self.versionInfoButton = QPushButton(TabAbout)
|
||||
self.versionInfoButton.setObjectName(u"versionInfoButton")
|
||||
|
||||
self.horizontalLayout.addWidget(self.versionInfoButton)
|
||||
|
||||
self.horizontalSpacer_2 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
|
||||
|
||||
self.horizontalLayout.addItem(self.horizontalSpacer_2)
|
||||
|
||||
|
||||
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||
|
||||
|
||||
self.retranslateUi(TabAbout)
|
||||
|
||||
QMetaObject.connectSlotsByName(TabAbout)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, TabAbout):
|
||||
self.aboutQtButton.setText(QCoreApplication.translate("TabAbout", u"About Qt", None))
|
||||
self.versionInfoButton.setText(QCoreApplication.translate("TabAbout", u"Version Info", None))
|
||||
pass
|
||||
# retranslateUi
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
from PySide6.QtCore import Qt, Slot
|
||||
from PySide6.QtCore import QFile, Qt, Slot
|
||||
from PySide6.QtGui import QPixmap
|
||||
from PySide6.QtWidgets import QMessageBox, QWidget
|
||||
|
||||
@ -21,3 +21,11 @@ class TabAbout(Ui_TabAbout, QWidget):
|
||||
@Slot()
|
||||
def on_aboutQtButton_clicked(self):
|
||||
QMessageBox.aboutQt(self)
|
||||
|
||||
@Slot()
|
||||
def on_versionInfoButton_clicked(self):
|
||||
versionFile = QFile(":/VERSION")
|
||||
versionFile.open(QFile.OpenModeFlag.ReadOnly)
|
||||
versionText = str(versionFile.readAll(), encoding="utf-8")
|
||||
versionFile.close()
|
||||
QMessageBox.information(self, None, versionText)
|
||||
|
@ -1,6 +1,8 @@
|
||||
<!DOCTYPE RCC>
|
||||
<RCC version="1.0">
|
||||
<qresource prefix="/">
|
||||
<file>VERSION</file>
|
||||
|
||||
<file>images/icon.png</file>
|
||||
<file>images/logo.png</file>
|
||||
<file>images/stepCalculator/stamina.png</file>
|
||||
|
Loading…
x
Reference in New Issue
Block a user