From a625cebd31c85436f7340a8df99cba2203bb65a8 Mon Sep 17 00:00:00 2001 From: Slendi Date: Mon, 21 Aug 2023 21:46:00 +0300 Subject: [PATCH] Add score column by calculating freq*length. Signed-off-by: Slendi --- src/nexus/GUI.py | 3 +++ translations/i18n_en.ts | 24 ++++++++++++++---------- ui/main.ui | 7 ++++++- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/nexus/GUI.py b/src/nexus/GUI.py index e336974..83dacb1 100644 --- a/src/nexus/GUI.py +++ b/src/nexus/GUI.py @@ -173,6 +173,9 @@ def refresh(self): item = QTableWidgetItem() item.setData(Qt.ItemDataRole.DisplayRole, str(word.average_speed)[2:-3]) self.chentry_table.setItem(i, 3, item) + item = QTableWidgetItem() + item.setData(Qt.ItemDataRole.DisplayRole, str(len(word.word) * word.frequency)) + self.chentry_table.setItem(i, 4, item) self.chentry_table.setRowCount(len(words)) self.chentry_table.resizeColumnsToContents() diff --git a/translations/i18n_en.ts b/translations/i18n_en.ts index 252a37c..787a40b 100644 --- a/translations/i18n_en.ts +++ b/translations/i18n_en.ts @@ -83,56 +83,55 @@ GUI - - + GUI Start logging - + GUI Starting... - + GUI Stop logging - + GUI Logging started - + GUI Logging stopped - + GUI Loaded {} freqlogged words - + GUI Unban {} words - + GUI Unban one word - + GUI Exported {} words to {} @@ -206,5 +205,10 @@ Avg speed + + + Score + + diff --git a/ui/main.ui b/ui/main.ui index 2ace8d6..cbb4b51 100644 --- a/ui/main.ui +++ b/ui/main.ui @@ -152,7 +152,7 @@ false - 4 + 5 true @@ -189,6 +189,11 @@ Avg speed + + + Score + +