diff --git a/ui/designer/tabs/tabOverview.ui b/ui/designer/tabs/tabOverview.ui index d296c37..60bdf1f 100644 --- a/ui/designer/tabs/tabOverview.ui +++ b/ui/designer/tabs/tabOverview.ui @@ -20,7 +20,7 @@ - databaseDescribeLabel {} {} {} {} {} {} + ... diff --git a/ui/designer/tabs/tabOverview_ui.py b/ui/designer/tabs/tabOverview_ui.py index 343afdb..a2b026f 100644 --- a/ui/designer/tabs/tabOverview_ui.py +++ b/ui/designer/tabs/tabOverview_ui.py @@ -33,6 +33,7 @@ class Ui_TabOverview(object): self.databaseDescribeLabel = QLabel(TabOverview) self.databaseDescribeLabel.setObjectName(u"databaseDescribeLabel") + self.databaseDescribeLabel.setText(u"...") self.verticalLayout.addWidget(self.databaseDescribeLabel) @@ -108,7 +109,6 @@ class Ui_TabOverview(object): # setupUi def retranslateUi(self, TabOverview): - self.databaseDescribeLabel.setText(QCoreApplication.translate("TabOverview", u"databaseDescribeLabel {} {} {} {} {} {}", None)) pass # retranslateUi diff --git a/ui/implements/tabs/tabOverview.py b/ui/implements/tabs/tabOverview.py index ff8b454..d419bb4 100644 --- a/ui/implements/tabs/tabOverview.py +++ b/ui/implements/tabs/tabOverview.py @@ -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 diff --git a/ui/resources/lang/en_US.ts b/ui/resources/lang/en_US.ts index 8eb2cb2..b6bc12b 100644 --- a/ui/resources/lang/en_US.ts +++ b/ui/resources/lang/en_US.ts @@ -752,7 +752,7 @@ validation databaseDescribeLabel {} {} {} {} {} {} This database now have {} packs, {} songs, {} difficulties, {} chart info ({} complete) and {} scores. - This database now have {} packs, {} songs, {} difficulties, {} chart info ({} complete) and {} scores. + There are {} packs, {} songs, {} difficulties, {} chart info ({} complete) and {} scores in database.