mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-30 07:44:22 +08:00
Small code improvements
This commit is contained in:
parent
82a1c95d98
commit
c9145c6661
@ -18,13 +18,11 @@ Column
|
|||||||
readyLabel: catalog.i18nc("@action:button", "Update")
|
readyLabel: catalog.i18nc("@action:button", "Update")
|
||||||
activeLabel: catalog.i18nc("@action:button", "Updating")
|
activeLabel: catalog.i18nc("@action:button", "Updating")
|
||||||
completeLabel: catalog.i18nc("@action:button", "Updated")
|
completeLabel: catalog.i18nc("@action:button", "Updated")
|
||||||
readyAction: function() {
|
readyAction: {
|
||||||
toolbox.activePackage = model
|
toolbox.activePackage = model
|
||||||
toolbox.update(model.id)
|
toolbox.update(model.id)
|
||||||
}
|
}
|
||||||
activeAction: function() {
|
activeAction: toolbox.cancelDownload()
|
||||||
toolbox.cancelDownload()
|
|
||||||
}
|
|
||||||
// Don't allow installing while another download is running
|
// Don't allow installing while another download is running
|
||||||
enabled: !(toolbox.isDownloading && toolbox.activePackage != model)
|
enabled: !(toolbox.isDownloading && toolbox.activePackage != model)
|
||||||
opacity: enabled ? 1.0 : 0.5
|
opacity: enabled ? 1.0 : 0.5
|
||||||
|
@ -313,9 +313,9 @@ class Toolbox(QObject, Extension):
|
|||||||
if remote_package is None:
|
if remote_package is None:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
local_version = local_package["package_version"]
|
local_version = Version(local_package["package_version"])
|
||||||
remote_version = remote_package["package_version"]
|
remote_version = Version(remote_package["package_version"])
|
||||||
return Version(remote_version) > Version(local_version)
|
return remote_version > local_version
|
||||||
|
|
||||||
@pyqtSlot(str, result = bool)
|
@pyqtSlot(str, result = bool)
|
||||||
def isInstalled(self, package_id: str) -> bool:
|
def isInstalled(self, package_id: str) -> bool:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user