Skip to content

Commit

Permalink
Add score column by calculating freq*length.
Browse files Browse the repository at this point in the history
Signed-off-by: Slendi <[email protected]>
  • Loading branch information
xslendix committed Aug 21, 2023
1 parent c71960e commit a625ceb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
3 changes: 3 additions & 0 deletions src/nexus/GUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
24 changes: 14 additions & 10 deletions translations/i18n_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,56 +83,55 @@
<context>
<name>GUI</name>
<message>
<location filename="../src/nexus/GUI.py" line="108"/>
<location filename="../src/nexus/GUI.py" line="140"/>
<location filename="../src/nexus/GUI.py" line="142"/>
<source>GUI</source>
<comment>Start logging</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/nexus/GUI.py" line="110"/>
<location filename="../src/nexus/GUI.py" line="111"/>
<source>GUI</source>
<comment>Starting...</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/nexus/GUI.py" line="121"/>
<location filename="../src/nexus/GUI.py" line="122"/>
<source>GUI</source>
<comment>Stop logging</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/nexus/GUI.py" line="125"/>
<location filename="../src/nexus/GUI.py" line="127"/>
<source>GUI</source>
<comment>Logging started</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/nexus/GUI.py" line="144"/>
<location filename="../src/nexus/GUI.py" line="147"/>
<source>GUI</source>
<comment>Logging stopped</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/nexus/GUI.py" line="177"/>
<location filename="../src/nexus/GUI.py" line="183"/>
<source>GUI</source>
<comment>Loaded {} freqlogged words</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/nexus/GUI.py" line="240"/>
<location filename="../src/nexus/GUI.py" line="246"/>
<source>GUI</source>
<comment>Unban {} words</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/nexus/GUI.py" line="242"/>
<location filename="../src/nexus/GUI.py" line="248"/>
<source>GUI</source>
<comment>Unban one word</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/nexus/GUI.py" line="259"/>
<location filename="../src/nexus/GUI.py" line="265"/>
<source>GUI</source>
<comment>Exported {} words to {}</comment>
<translation type="unfinished"></translation>
Expand Down Expand Up @@ -206,5 +205,10 @@
<source>Avg speed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/main.ui" line="194"/>
<source>Score</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
7 changes: 6 additions & 1 deletion ui/main.ui
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
<bool>false</bool>
</property>
<property name="columnCount">
<number>4</number>
<number>5</number>
</property>
<attribute name="horizontalHeaderVisible">
<bool>true</bool>
Expand Down Expand Up @@ -189,6 +189,11 @@
<string>Avg speed</string>
</property>
</column>
<column>
<property name="text">
<string>Score</string>
</property>
</column>
</widget>
</item>
</layout>
Expand Down

0 comments on commit a625ceb

Please sign in to comment.