mirror of
https://github.com/283375/arcaea-offline-pyside-ui.git
synced 2025-04-19 09:10: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.db
|
||||||
arcaea_offline.ini
|
arcaea_offline.ini
|
||||||
|
|
||||||
|
ui/resources/VERSION
|
||||||
|
|
||||||
# Qt compiled stuff
|
# Qt compiled stuff
|
||||||
*.qm
|
*.qm
|
||||||
*_rc.py
|
*_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>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>587</width>
|
<width>550</width>
|
||||||
<height>431</height>
|
<height>400</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -80,6 +80,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="versionInfoButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Version Info</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer_2">
|
<spacer name="horizontalSpacer_2">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
################################################################################
|
################################################################################
|
||||||
## Form generated from reading UI file 'tabAbout.ui'
|
## Form generated from reading UI file 'tabAbout.ui'
|
||||||
##
|
##
|
||||||
## Created by: Qt User Interface Compiler version 6.5.0
|
## Created by: Qt User Interface Compiler version 6.5.2
|
||||||
##
|
##
|
||||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||||
################################################################################
|
################################################################################
|
||||||
@ -22,7 +22,7 @@ class Ui_TabAbout(object):
|
|||||||
def setupUi(self, TabAbout):
|
def setupUi(self, TabAbout):
|
||||||
if not TabAbout.objectName():
|
if not TabAbout.objectName():
|
||||||
TabAbout.setObjectName(u"TabAbout")
|
TabAbout.setObjectName(u"TabAbout")
|
||||||
TabAbout.resize(587, 431)
|
TabAbout.resize(550, 400)
|
||||||
TabAbout.setWindowTitle(u"TabAbout")
|
TabAbout.setWindowTitle(u"TabAbout")
|
||||||
self.verticalLayout = QVBoxLayout(TabAbout)
|
self.verticalLayout = QVBoxLayout(TabAbout)
|
||||||
self.verticalLayout.setObjectName(u"verticalLayout")
|
self.verticalLayout.setObjectName(u"verticalLayout")
|
||||||
@ -67,6 +67,11 @@ class Ui_TabAbout(object):
|
|||||||
|
|
||||||
self.horizontalLayout.addWidget(self.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.horizontalSpacer_2 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
|
||||||
|
|
||||||
self.horizontalLayout.addItem(self.horizontalSpacer_2)
|
self.horizontalLayout.addItem(self.horizontalSpacer_2)
|
||||||
@ -82,6 +87,7 @@ class Ui_TabAbout(object):
|
|||||||
|
|
||||||
def retranslateUi(self, TabAbout):
|
def retranslateUi(self, TabAbout):
|
||||||
self.aboutQtButton.setText(QCoreApplication.translate("TabAbout", u"About Qt", None))
|
self.aboutQtButton.setText(QCoreApplication.translate("TabAbout", u"About Qt", None))
|
||||||
|
self.versionInfoButton.setText(QCoreApplication.translate("TabAbout", u"Version Info", None))
|
||||||
pass
|
pass
|
||||||
# retranslateUi
|
# 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.QtGui import QPixmap
|
||||||
from PySide6.QtWidgets import QMessageBox, QWidget
|
from PySide6.QtWidgets import QMessageBox, QWidget
|
||||||
|
|
||||||
@ -21,3 +21,11 @@ class TabAbout(Ui_TabAbout, QWidget):
|
|||||||
@Slot()
|
@Slot()
|
||||||
def on_aboutQtButton_clicked(self):
|
def on_aboutQtButton_clicked(self):
|
||||||
QMessageBox.aboutQt(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>
|
<!DOCTYPE RCC>
|
||||||
<RCC version="1.0">
|
<RCC version="1.0">
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
|
<file>VERSION</file>
|
||||||
|
|
||||||
<file>images/icon.png</file>
|
<file>images/icon.png</file>
|
||||||
<file>images/logo.png</file>
|
<file>images/logo.png</file>
|
||||||
<file>images/stepCalculator/stamina.png</file>
|
<file>images/stepCalculator/stamina.png</file>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user