Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File versions display update #1255

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions newsfragments/1220.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update the file version display in the GUI.
6 changes: 5 additions & 1 deletion parsec/core/gui/file_history_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ class FileHistoryButton(QWidget, Ui_FileHistoryButton):
def __init__(self, version, creator, name, size, src, dst, timestamp):
super().__init__()
self.setupUi(self)
self.label_version.setText(str(version))
if version <= 1:
version_str = _("TEXT_FILE_HISTORY_CREATION")
else:
version_str = str(version - 1)
self.label_version.setText(version_str)
self.label_user.setText(creator)
self.label_size.setText(get_filesize(size) if size is not None else "")
self.label_date.setText(format_datetime(timestamp))
Expand Down
3 changes: 3 additions & 0 deletions parsec/core/gui/tr/parsec_en.po
Original file line number Diff line number Diff line change
Expand Up @@ -2114,6 +2114,9 @@ msgstr ""
msgid "TEXT_FILE_HISTORY_VERSION"
msgstr "Version"

msgid "TEXT_FILE_HISTORY_CREATION"
msgstr "data creation"

msgid "TEXT_FILE_HISTORY_SIZE"
msgstr "Size"

Expand Down
3 changes: 3 additions & 0 deletions parsec/core/gui/tr/parsec_fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -2167,6 +2167,9 @@ msgstr ""
msgid "TEXT_FILE_HISTORY_VERSION"
msgstr "Version"

msgid "TEXT_FILE_HISTORY_CREATION"
msgstr "création"

msgid "TEXT_FILE_HISTORY_SIZE"
msgstr "Taille"

Expand Down
2 changes: 1 addition & 1 deletion tests/core/gui/test_file_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ def _history_displayed():
assert hf_w.layout_history.count() == 1
hb2_w = hf_w.layout_history.itemAt(0).widget()
assert hb2_w.label_user.text() == "Boby McBobFace"
assert hb2_w.label_version.text() == "2"
assert hb2_w.label_version.text() == "1"

await aqtbot.wait_until(_history_displayed)