mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
Added material conflict option
This is still desabled by default due to some architecture issues (so this is temporarily left as it is) CURA-1263
This commit is contained in:
parent
b59be4c88b
commit
b175e6876f
3 changed files with 71 additions and 5 deletions
|
@ -18,15 +18,19 @@ class WorkspaceDialog(QObject):
|
|||
self._qml_url = "WorkspaceDialog.qml"
|
||||
self._lock = threading.Lock()
|
||||
self._default_strategy = "override"
|
||||
self._result = {"machine": self._default_strategy, "quality_changes": self._default_strategy}
|
||||
self._result = {"machine": self._default_strategy,
|
||||
"quality_changes": self._default_strategy,
|
||||
"material": self._default_strategy}
|
||||
self._visible = False
|
||||
self.showDialogSignal.connect(self.__show)
|
||||
|
||||
self._has_quality_changes_conflict = False
|
||||
self._has_machine_conflict = False
|
||||
self._has_material_conflict = False
|
||||
|
||||
machineConflictChanged = pyqtSignal()
|
||||
qualityChangesConflictChanged = pyqtSignal()
|
||||
materialConflictChanged = pyqtSignal()
|
||||
|
||||
@pyqtProperty(bool, notify = machineConflictChanged)
|
||||
def machineConflict(self):
|
||||
|
@ -36,11 +40,19 @@ class WorkspaceDialog(QObject):
|
|||
def qualityChangesConflict(self):
|
||||
return self._has_quality_changes_conflict
|
||||
|
||||
@pyqtProperty(bool, notify=materialConflictChanged)
|
||||
def materialConflict(self):
|
||||
return self._has_material_conflict
|
||||
|
||||
@pyqtSlot(str, str)
|
||||
def setResolveStrategy(self, key, strategy):
|
||||
if key in self._result:
|
||||
self._result[key] = strategy
|
||||
|
||||
def setMaterialConflict(self, material_conflict):
|
||||
self._has_material_conflict = material_conflict
|
||||
self.materialConflictChanged.emit()
|
||||
|
||||
def setMachineConflict(self, machine_conflict):
|
||||
self._has_machine_conflict = machine_conflict
|
||||
self.machineConflictChanged.emit()
|
||||
|
@ -54,6 +66,8 @@ class WorkspaceDialog(QObject):
|
|||
self._result["machine"] = None
|
||||
if "quality_changes" in self._result and not self._has_quality_changes_conflict:
|
||||
self._result["quality_changes"] = None
|
||||
if "material" in self._result and not self._has_material_conflict:
|
||||
self._result["material"] = None
|
||||
return self._result
|
||||
|
||||
def _createViewFromQML(self):
|
||||
|
@ -63,14 +77,16 @@ class WorkspaceDialog(QObject):
|
|||
self._context.setContextProperty("manager", self)
|
||||
self._view = self._component.create(self._context)
|
||||
if self._view is None:
|
||||
Logger.log("e", "QQmlComponent status %s", self._component.status())
|
||||
Logger.log("e", "QQmlComponent errorString %s", self._component.errorString())
|
||||
Logger.log("c", "QQmlComponent status %s", self._component.status())
|
||||
Logger.log("c", "QQmlComponent error string %s", self._component.errorString())
|
||||
|
||||
def show(self):
|
||||
# Emit signal so the right thread actually shows the view.
|
||||
self._lock.acquire()
|
||||
# Reset the result
|
||||
self._result = {"machine": self._default_strategy, "quality_changes": self._default_strategy}
|
||||
self._result = {"machine": self._default_strategy,
|
||||
"quality_changes": self._default_strategy,
|
||||
"material": self._default_strategy}
|
||||
self._visible = True
|
||||
self.showDialogSignal.emit()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue