mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Minor refactor
This commit is contained in:
parent
8268419eda
commit
1bacdabf35
1 changed files with 12 additions and 12 deletions
|
@ -776,25 +776,25 @@ class Toolbox(QObject, Extension):
|
|||
# Filter Models:
|
||||
# --------------------------------------------------------------------------
|
||||
@pyqtSlot(str, str, str)
|
||||
def filterModelByProp(self, modelType: str, filterType: str, parameter: str):
|
||||
if not self._models[modelType]:
|
||||
Logger.log("w", "Toolbox: Couldn't filter %s model because it doesn't exist.", modelType)
|
||||
def filterModelByProp(self, model_type: str, filter_type: str, parameter: str) -> None:
|
||||
if not self._models[model_type]:
|
||||
Logger.log("w", "Toolbox: Couldn't filter %s model because it doesn't exist.", model_type)
|
||||
return
|
||||
self._models[modelType].setFilter({ filterType: parameter })
|
||||
self._models[model_type].setFilter({filter_type: parameter})
|
||||
self.filterChanged.emit()
|
||||
|
||||
@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)
|
||||
def setFilters(self, model_type: str, filter_dict: dict) -> None:
|
||||
if not self._models[model_type]:
|
||||
Logger.log("w", "Toolbox: Couldn't filter %s model because it doesn't exist.", model_type)
|
||||
return
|
||||
self._models[modelType].setFilter(filterDict)
|
||||
self._models[model_type].setFilter(filter_dict)
|
||||
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)
|
||||
def removeFilters(self, model_type: str) -> None:
|
||||
if not self._models[model_type]:
|
||||
Logger.log("w", "Toolbox: Couldn't remove filters on %s model because it doesn't exist.", model_type)
|
||||
return
|
||||
self._models[modelType].setFilter({})
|
||||
self._models[model_type].setFilter({})
|
||||
self.filterChanged.emit()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue