mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-12 01:07:52 -06:00
Add downloadnumber to model and plugin view
This commit is contained in:
parent
8c3d4f1011
commit
5fe812b4a4
2 changed files with 16 additions and 1 deletions
|
@ -92,6 +92,12 @@ Item
|
||||||
font: UM.Theme.getFont("very_small")
|
font: UM.Theme.getFont("very_small")
|
||||||
color: UM.Theme.getColor("text_medium")
|
color: UM.Theme.getColor("text_medium")
|
||||||
}
|
}
|
||||||
|
Label
|
||||||
|
{
|
||||||
|
text: catalog.i18nc("@label", "Downloads") + ":"
|
||||||
|
font: UM.Theme.getFont("very_small")
|
||||||
|
color: UM.Theme.getColor("text_medium")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Column
|
Column
|
||||||
{
|
{
|
||||||
|
@ -138,6 +144,12 @@ Item
|
||||||
linkColor: UM.Theme.getColor("text_link")
|
linkColor: UM.Theme.getColor("text_link")
|
||||||
onLinkActivated: Qt.openUrlExternally(link)
|
onLinkActivated: Qt.openUrlExternally(link)
|
||||||
}
|
}
|
||||||
|
Label
|
||||||
|
{
|
||||||
|
text: details.download_count || catalog.i18nc("@label", "Unknown")
|
||||||
|
font: UM.Theme.getFont("very_small")
|
||||||
|
color: UM.Theme.getColor("text")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Rectangle
|
Rectangle
|
||||||
{
|
{
|
||||||
|
|
|
@ -32,6 +32,7 @@ class PackagesModel(ListModel):
|
||||||
self.addRoleName(Qt.UserRole + 15, "is_installed") # Scheduled pkgs are included in the model but should not be marked as actually installed
|
self.addRoleName(Qt.UserRole + 15, "is_installed") # Scheduled pkgs are included in the model but should not be marked as actually installed
|
||||||
self.addRoleName(Qt.UserRole + 16, "has_configs")
|
self.addRoleName(Qt.UserRole + 16, "has_configs")
|
||||||
self.addRoleName(Qt.UserRole + 17, "supported_configs")
|
self.addRoleName(Qt.UserRole + 17, "supported_configs")
|
||||||
|
self.addRoleName(Qt.UserRole + 18, "download_count")
|
||||||
|
|
||||||
# List of filters for queries. The result is the union of the each list of results.
|
# List of filters for queries. The result is the union of the each list of results.
|
||||||
self._filter = {} # type: Dict[str, str]
|
self._filter = {} # type: Dict[str, str]
|
||||||
|
@ -76,7 +77,9 @@ class PackagesModel(ListModel):
|
||||||
"is_enabled": package["is_enabled"] if "is_enabled" in package else False,
|
"is_enabled": package["is_enabled"] if "is_enabled" in package else False,
|
||||||
"is_installed": package["is_installed"] if "is_installed" in package else False,
|
"is_installed": package["is_installed"] if "is_installed" in package else False,
|
||||||
"has_configs": has_configs,
|
"has_configs": has_configs,
|
||||||
"supported_configs": configs_model
|
"supported_configs": configs_model,
|
||||||
|
"download_count": package["download_count"] if "download_count" in package else 0
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
# Filter on all the key-word arguments.
|
# Filter on all the key-word arguments.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue