mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-21 05:09:37 +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 PyQt6.QtCore import Qt
|
||||||
|
|
||||||
|
from UM.Logger import Logger
|
||||||
from UM.Settings.SettingDefinition import SettingDefinition
|
from UM.Settings.SettingDefinition import SettingDefinition
|
||||||
from UM.Qt.ListModel import ListModel
|
from UM.Qt.ListModel import ListModel
|
||||||
|
|
||||||
@ -19,6 +20,8 @@ class SpecificSettingsModel(ListModel):
|
|||||||
self.addRoleName(self.ValueRole, "value")
|
self.addRoleName(self.ValueRole, "value")
|
||||||
|
|
||||||
self._i18n_catalog = None
|
self._i18n_catalog = None
|
||||||
|
self._update()
|
||||||
|
|
||||||
|
|
||||||
def addSettingsFromStack(self, stack, category, settings):
|
def addSettingsFromStack(self, stack, category, settings):
|
||||||
for setting, value in settings.items():
|
for setting, value in settings.items():
|
||||||
@ -36,3 +39,8 @@ class SpecificSettingsModel(ListModel):
|
|||||||
"label": stack.getProperty(setting, "label"),
|
"label": stack.getProperty(setting, "label"),
|
||||||
"value": value
|
"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):
|
def allowCreateMachine(self):
|
||||||
return self._allow_create_machine
|
return self._allow_create_machine
|
||||||
|
|
||||||
@pyqtProperty(QObject, constant = True)
|
@pyqtProperty(QObject)
|
||||||
def exportedSettingModel(self):
|
def exportedSettingModel(self):
|
||||||
return self._exported_settings_model
|
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")
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
Cura.TableView
|
Cura.TableView
|
||||||
{
|
{
|
||||||
id: tableViewSpecificSettings
|
id: tableViewSpecificSettings
|
||||||
@ -239,6 +238,13 @@ UM.Dialog
|
|||||||
rows: manager.exportedSettingModel.items
|
rows: manager.exportedSettingModel.items
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
property var modelRows: manager.exportedSettingModel.items
|
||||||
|
onModelRowsChanged:
|
||||||
|
{
|
||||||
|
tableModel.clear()
|
||||||
|
tableModel.rows = modelRows
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
comboboxVisible: manager.qualityChangesConflict
|
comboboxVisible: manager.qualityChangesConflict
|
||||||
|
Loading…
x
Reference in New Issue
Block a user