mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 01:37:51 -06:00
Add changed checks to prevent unneeded signals from being fired
CURA-6006
This commit is contained in:
parent
6a466c99b2
commit
2602d5bf02
1 changed files with 10 additions and 7 deletions
|
@ -546,7 +546,7 @@ class Toolbox(QObject, Extension):
|
||||||
|
|
||||||
# Check for plugins that were installed with the old plugin browser
|
# Check for plugins that were installed with the old plugin browser
|
||||||
def isOldPlugin(self, plugin_id: str) -> bool:
|
def isOldPlugin(self, plugin_id: str) -> bool:
|
||||||
return plugin_id in self._old_plugin_ids
|
return plugin_id in self._old_plugin_ids
|
||||||
|
|
||||||
def getOldPluginPackageMetadata(self, plugin_id: str) -> Optional[Dict[str, Any]]:
|
def getOldPluginPackageMetadata(self, plugin_id: str) -> Optional[Dict[str, Any]]:
|
||||||
return self._old_plugin_metadata.get(plugin_id)
|
return self._old_plugin_metadata.get(plugin_id)
|
||||||
|
@ -709,8 +709,9 @@ class Toolbox(QObject, Extension):
|
||||||
return self._is_downloading
|
return self._is_downloading
|
||||||
|
|
||||||
def setActivePackage(self, package: Dict[str, Any]) -> None:
|
def setActivePackage(self, package: Dict[str, Any]) -> None:
|
||||||
self._active_package = package
|
if self._active_package != package:
|
||||||
self.activePackageChanged.emit()
|
self._active_package = package
|
||||||
|
self.activePackageChanged.emit()
|
||||||
|
|
||||||
## The active package is the package that is currently being downloaded
|
## The active package is the package that is currently being downloaded
|
||||||
@pyqtProperty(QObject, fset = setActivePackage, notify = activePackageChanged)
|
@pyqtProperty(QObject, fset = setActivePackage, notify = activePackageChanged)
|
||||||
|
@ -718,16 +719,18 @@ class Toolbox(QObject, Extension):
|
||||||
return self._active_package
|
return self._active_package
|
||||||
|
|
||||||
def setViewCategory(self, category: str = "plugin") -> None:
|
def setViewCategory(self, category: str = "plugin") -> None:
|
||||||
self._view_category = category
|
if self._view_category != category:
|
||||||
self.viewChanged.emit()
|
self._view_category = category
|
||||||
|
self.viewChanged.emit()
|
||||||
|
|
||||||
@pyqtProperty(str, fset = setViewCategory, notify = viewChanged)
|
@pyqtProperty(str, fset = setViewCategory, notify = viewChanged)
|
||||||
def viewCategory(self) -> str:
|
def viewCategory(self) -> str:
|
||||||
return self._view_category
|
return self._view_category
|
||||||
|
|
||||||
def setViewPage(self, page: str = "overview") -> None:
|
def setViewPage(self, page: str = "overview") -> None:
|
||||||
self._view_page = page
|
if self._view_page != page:
|
||||||
self.viewChanged.emit()
|
self._view_page = page
|
||||||
|
self.viewChanged.emit()
|
||||||
|
|
||||||
@pyqtProperty(str, fset = setViewPage, notify = viewChanged)
|
@pyqtProperty(str, fset = setViewPage, notify = viewChanged)
|
||||||
def viewPage(self) -> str:
|
def viewPage(self) -> str:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue