mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 17:59:00 +08:00
Only show material packages when clicking an author
Contributes to CURA-5604
This commit is contained in:
parent
99cb9e93b3
commit
2a6da9fe8e
@ -115,6 +115,10 @@ Item
|
||||
{
|
||||
toolbox.viewPage = "author"
|
||||
toolbox.filterModelByProp("packages", "author_id", model.id)
|
||||
toolbox.setFilters("packages", {
|
||||
"author_id": model.id,
|
||||
"type": "material"
|
||||
})
|
||||
}
|
||||
break
|
||||
default:
|
||||
|
@ -783,7 +783,16 @@ class Toolbox(QObject, Extension):
|
||||
self._models[modelType].setFilter({ filterType: parameter })
|
||||
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):
|
||||
if not self._models[modelType]:
|
||||
Logger.log("w", "Toolbox: Couldn't remove filters on %s model because it doesn't exist.", modelType)
|
||||
|
Loading…
x
Reference in New Issue
Block a user