mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 23:46:22 -06:00
Only show material packages when clicking an author
Contributes to CURA-5604
This commit is contained in:
parent
99cb9e93b3
commit
2a6da9fe8e
2 changed files with 14 additions and 1 deletions
|
@ -115,6 +115,10 @@ Item
|
||||||
{
|
{
|
||||||
toolbox.viewPage = "author"
|
toolbox.viewPage = "author"
|
||||||
toolbox.filterModelByProp("packages", "author_id", model.id)
|
toolbox.filterModelByProp("packages", "author_id", model.id)
|
||||||
|
toolbox.setFilters("packages", {
|
||||||
|
"author_id": model.id,
|
||||||
|
"type": "material"
|
||||||
|
})
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -783,7 +783,16 @@ class Toolbox(QObject, Extension):
|
||||||
self._models[modelType].setFilter({ filterType: parameter })
|
self._models[modelType].setFilter({ filterType: parameter })
|
||||||
self.filterChanged.emit()
|
self.filterChanged.emit()
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot(str, "QVariantMap")
|
||||||
|
def setFilters(self, modelType: str, filterDict: dict):
|
||||||
|
if not self._models[modelType]:
|
||||||
|
Logger.log("w", "Toolbox: Couldn't filter %s model because it doesn't exist.", modelType)
|
||||||
|
return
|
||||||
|
print(filterDict)
|
||||||
|
self._models[modelType].setFilter(filterDict)
|
||||||
|
self.filterChanged.emit()
|
||||||
|
|
||||||
|
@pyqtSlot(str)
|
||||||
def removeFilters(self, modelType: str):
|
def removeFilters(self, modelType: str):
|
||||||
if not self._models[modelType]:
|
if not self._models[modelType]:
|
||||||
Logger.log("w", "Toolbox: Couldn't remove filters on %s model because it doesn't exist.", modelType)
|
Logger.log("w", "Toolbox: Couldn't remove filters on %s model because it doesn't exist.", modelType)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue