mirror of
https://github.com/283375/arcaea-offline-pyside-ui.git
synced 2025-07-01 12:26:26 +00:00
impr: TabOverview
describe label
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
from arcaea_offline.database import Database
|
||||
from PySide6.QtCore import QCoreApplication
|
||||
from PySide6.QtGui import QShowEvent
|
||||
from PySide6.QtWidgets import QWidget
|
||||
|
||||
@ -15,8 +16,6 @@ class TabOverview(Ui_TabOverview, QWidget):
|
||||
self.installEventFilter(self.languageChangeEventFilter)
|
||||
|
||||
self.db = Database()
|
||||
# self.db.register_update_hook(self.updateOverview)
|
||||
# self.updateOverview()
|
||||
|
||||
def showEvent(self, event: QShowEvent) -> None:
|
||||
self.updateOverview()
|
||||
@ -25,18 +24,19 @@ class TabOverview(Ui_TabOverview, QWidget):
|
||||
def updateOverview(self):
|
||||
b30 = self.db.get_b30() or 0.00
|
||||
self.b30Label.setText(str(f"{b30:.3f}"))
|
||||
self.retranslateUi(self)
|
||||
self.databaseDescribeLabel.setText(
|
||||
self.describeFormatString.format(
|
||||
self.db.count_packs(),
|
||||
self.db.count_songs(),
|
||||
self.db.count_difficulties(),
|
||||
self.db.count_chart_infos(),
|
||||
self.db.count_complete_chart_infos(),
|
||||
self.db.count_scores(),
|
||||
)
|
||||
)
|
||||
|
||||
def retranslateUi(self, *args):
|
||||
super().retranslateUi(self)
|
||||
db = Database()
|
||||
describeText = self.databaseDescribeLabel.text()
|
||||
describeText = describeText.format(
|
||||
db.count_packs(),
|
||||
db.count_songs(),
|
||||
db.count_difficulties(),
|
||||
db.count_chart_infos(),
|
||||
db.count_complete_chart_infos(),
|
||||
db.count_scores(),
|
||||
)
|
||||
self.databaseDescribeLabel.setText(describeText)
|
||||
# fmt: off
|
||||
self.describeFormatString = QCoreApplication.translate("TabOverview", "databaseDescribeLabel {} {} {} {} {} {}")
|
||||
# fmt: on
|
||||
|
Reference in New Issue
Block a user