Add dedicate functions for exportedSettingModelItems and exportedSettingModelRowCount

This commit is contained in:
c.lamboo 2024-03-18 12:14:58 +01:00
parent a58cd69b39
commit 4dd0113a78
2 changed files with 9 additions and 9 deletions

View file

@ -362,6 +362,13 @@ class WorkspaceDialog(QObject):
def exportedSettingModel(self): def exportedSettingModel(self):
return self._exported_settings_model return self._exported_settings_model
@pyqtProperty("QVariantList", notify=exportedSettingModelChanged)
def exportedSettingModelItems(self):
return self._exported_settings_model.items
@pyqtProperty(int, notify=exportedSettingModelChanged)
def exportedSettingModelRowCount(self):
return self._exported_settings_model.rowCount()
@pyqtSlot() @pyqtSlot()
def closeBackend(self) -> None: def closeBackend(self) -> None:
"""Close the backend: otherwise one could end up with "Slicing...""" """Close the backend: otherwise one could end up with "Slicing..."""

View file

@ -173,7 +173,7 @@ UM.Dialog
{ {
id: numberOfOverrides id: numberOfOverrides
leftLabelText: catalog.i18nc("@action:label", "Settings Loaded from UCP file") leftLabelText: catalog.i18nc("@action:label", "Settings Loaded from UCP file")
rightLabelText: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", manager.exportedSettingModel.rowCount()).arg(manager.exportedSettingModel.rowCount()) rightLabelText: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", manager.exportedSettingModelRowCount).arg(manager.exportedSettingModelRowCount)
buttonText: tableViewSpecificSettings.shouldBeVisible ? catalog.i18nc("@action:button", "Hide settings") : catalog.i18nc("@action:button", "Show settings") buttonText: tableViewSpecificSettings.shouldBeVisible ? catalog.i18nc("@action:button", "Hide settings") : catalog.i18nc("@action:button", "Show settings")
onButtonClicked: tableViewSpecificSettings.shouldBeVisible = !tableViewSpecificSettings.shouldBeVisible onButtonClicked: tableViewSpecificSettings.shouldBeVisible = !tableViewSpecificSettings.shouldBeVisible
} }
@ -196,16 +196,9 @@ UM.Dialog
{ {
id: tableModel id: tableModel
headers: ["category", "label", "value"] headers: ["category", "label", "value"]
rows: manager.exportedSettingModel.items rows: manager.exportedSettingModelItems
} }
} }
property var modelRows: manager.exportedSettingModel.items
onModelRowsChanged:
{
tableModel.clear()
tableModel.rows = modelRows
}
} }
comboboxVisible: manager.qualityChangesConflict comboboxVisible: manager.qualityChangesConflict