mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 23:23:57 -06:00
Merge branch 'CURA-8587_disable_update_install_and_uninstall' into CURA-8734_Package_card_refactor
This commit is contained in:
commit
fb92f1f49a
3 changed files with 15 additions and 8 deletions
|
@ -237,11 +237,17 @@ class PackageList(ListModel):
|
|||
if reply:
|
||||
reply_string = bytes(reply.readAll()).decode()
|
||||
Logger.error(f"Failed to download package: {package_id} due to {reply_string}")
|
||||
package = self.getPackageModel(package_id)
|
||||
if update:
|
||||
package.is_updating = ManageState.FAILED
|
||||
else:
|
||||
package.is_installing = ManageState.FAILED
|
||||
try:
|
||||
package = self.getPackageModel(package_id)
|
||||
if update:
|
||||
package.is_updating = ManageState.FAILED
|
||||
else:
|
||||
package.is_installing = ManageState.FAILED
|
||||
except RuntimeError:
|
||||
# Setting the ownership of this object to not qml can still result in a RuntimeError. Which can occur when quickly toggling
|
||||
# between de-/constructing Remote or Local PackageLists. This try-except is here to prevent a hard crash when the wrapped C++ object
|
||||
# was deleted when it was still parsing the response
|
||||
return
|
||||
|
||||
def subscribeUserToPackage(self, package_id: str, sdk_version: str) -> None:
|
||||
"""Subscribe the user (if logged in) to the package for a given SDK
|
||||
|
|
|
@ -7,6 +7,7 @@ from typing import Any, Dict, List, Optional
|
|||
|
||||
from PyQt5.QtCore import pyqtProperty, QObject, pyqtSignal
|
||||
|
||||
from cura.CuraApplication import CuraApplication
|
||||
from cura.Settings.CuraContainerRegistry import CuraContainerRegistry # To get names of materials we're compatible with.
|
||||
from UM.i18n import i18nCatalog # To translate placeholder names if data is not present.
|
||||
|
||||
|
@ -371,8 +372,8 @@ class PackageModel(QObject):
|
|||
self.stateManageButtonChanged.emit()
|
||||
|
||||
@pyqtProperty(bool, notify = stateManageButtonChanged)
|
||||
def isRecentlyInstalled(self):
|
||||
return self._is_recently_installed
|
||||
def installationStatus(self):
|
||||
return self._package_id in CuraApplication.getInstance().getPackageManager().getPackagesToInstall()
|
||||
|
||||
@property
|
||||
def can_downgrade(self) -> bool:
|
||||
|
|
|
@ -290,7 +290,7 @@ Rectangle
|
|||
secondaryText: catalog.i18nc("@button", "Uninstall")
|
||||
busySecondaryText: catalog.i18nc("@button", "Uninstalling...")
|
||||
confirmedSecondaryText: catalog.i18nc("@button", "Uninstalled")
|
||||
confirmedTextChoice: packageData.isRecentlyInstalled
|
||||
confirmedTextChoice: packageData.installationStatus
|
||||
enabled: !(enableManageButton.busy || updateManageButton.busy)
|
||||
|
||||
onClicked:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue