mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-04 11:14:21 +08:00
Sort changelog correctly (newest on top). [CURA-6057]
This commit is contained in:
parent
28dc187731
commit
7ceaade26d
@ -39,6 +39,8 @@ class TextManager(QObject):
|
|||||||
line = line.replace("[", "")
|
line = line.replace("[", "")
|
||||||
line = line.replace("]", "")
|
line = line.replace("]", "")
|
||||||
open_version = Version(line)
|
open_version = Version(line)
|
||||||
|
if open_version > Version([14, 99, 99]): # Bit of a hack: We released the 15.x.x versions before 2.x
|
||||||
|
open_version = Version([0, open_version.getMinor(), open_version.getRevision(), open_version.getPostfixVersion()])
|
||||||
open_header = ""
|
open_header = ""
|
||||||
change_logs_dict[open_version] = collections.OrderedDict()
|
change_logs_dict[open_version] = collections.OrderedDict()
|
||||||
elif line.startswith("*"):
|
elif line.startswith("*"):
|
||||||
@ -51,8 +53,11 @@ class TextManager(QObject):
|
|||||||
|
|
||||||
# Format changelog text
|
# Format changelog text
|
||||||
content = ""
|
content = ""
|
||||||
for version in change_logs_dict:
|
for version in sorted(change_logs_dict.keys(), reverse=True):
|
||||||
content += "<h1>" + str(version) + "</h1><br>"
|
text_version = version
|
||||||
|
if version < Version([1, 0, 0]): # Bit of a hack: We released the 15.x.x versions before 2.x
|
||||||
|
text_version = Version([15, version.getMinor(), version.getRevision(), version.getPostfixVersion()])
|
||||||
|
content += "<h1>" + str(text_version) + "</h1><br>"
|
||||||
content += ""
|
content += ""
|
||||||
for change in change_logs_dict[version]:
|
for change in change_logs_dict[version]:
|
||||||
if str(change) != "":
|
if str(change) != "":
|
||||||
|
@ -57,6 +57,11 @@ Item
|
|||||||
font: UM.Theme.getFont("default")
|
font: UM.Theme.getFont("default")
|
||||||
renderType: Text.NativeRendering
|
renderType: Text.NativeRendering
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component.onCompleted:
|
||||||
|
{
|
||||||
|
Scrollbar.vertical.position = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user