mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-20 20:59:48 +08:00
update the setting table while loading ucp the seond time
CURA-11403
This commit is contained in:
parent
72f6540627
commit
f19320cad8
@ -3,6 +3,7 @@
|
||||
|
||||
from PyQt6.QtCore import Qt
|
||||
|
||||
from UM.Logger import Logger
|
||||
from UM.Settings.SettingDefinition import SettingDefinition
|
||||
from UM.Qt.ListModel import ListModel
|
||||
|
||||
@ -19,6 +20,8 @@ class SpecificSettingsModel(ListModel):
|
||||
self.addRoleName(self.ValueRole, "value")
|
||||
|
||||
self._i18n_catalog = None
|
||||
self._update()
|
||||
|
||||
|
||||
def addSettingsFromStack(self, stack, category, settings):
|
||||
for setting, value in settings.items():
|
||||
@ -36,3 +39,8 @@ class SpecificSettingsModel(ListModel):
|
||||
"label": stack.getProperty(setting, "label"),
|
||||
"value": value
|
||||
})
|
||||
|
||||
def _update(self):
|
||||
Logger.log("d", "Updating {model_class_name}.".format(model_class_name = self.__class__.__name__))
|
||||
self.setItems([])
|
||||
return
|
||||
|
@ -332,7 +332,7 @@ class WorkspaceDialog(QObject):
|
||||
def allowCreateMachine(self):
|
||||
return self._allow_create_machine
|
||||
|
||||
@pyqtProperty(QObject, constant = True)
|
||||
@pyqtProperty(QObject)
|
||||
def exportedSettingModel(self):
|
||||
return self._exported_settings_model
|
||||
|
||||
|
@ -216,7 +216,6 @@ UM.Dialog
|
||||
buttonText: tableViewSpecificSettings.shouldBeVisible ? catalog.i18nc("@action:button", "Hide settings") : catalog.i18nc("@action:button", "Show settings")
|
||||
onButtonClicked: tableViewSpecificSettings.shouldBeVisible = !tableViewSpecificSettings.shouldBeVisible
|
||||
}
|
||||
|
||||
Cura.TableView
|
||||
{
|
||||
id: tableViewSpecificSettings
|
||||
@ -239,6 +238,13 @@ UM.Dialog
|
||||
rows: manager.exportedSettingModel.items
|
||||
}
|
||||
}
|
||||
|
||||
property var modelRows: manager.exportedSettingModel.items
|
||||
onModelRowsChanged:
|
||||
{
|
||||
tableModel.clear()
|
||||
tableModel.rows = modelRows
|
||||
}
|
||||
}
|
||||
|
||||
comboboxVisible: manager.qualityChangesConflict
|
||||
|
Loading…
x
Reference in New Issue
Block a user