mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Allow picking any printer of the same type when opening project file
A ComboBox was added under the "Update existing" combobox which will display all the available printers that are of the same type with the printer in the project file. With this feature, the user will be able to select any same-type preexisting printer in Cura to be updated, instead of always create a new one when the project file's printer is not in Cura. CURA-7609
This commit is contained in:
parent
f9c6bbb092
commit
98cc87d1cf
3 changed files with 82 additions and 24 deletions
|
@ -29,6 +29,7 @@ class WorkspaceDialog(QObject):
|
|||
"quality_changes": self._default_strategy,
|
||||
"definition_changes": self._default_strategy,
|
||||
"material": self._default_strategy}
|
||||
self._override_machine = None
|
||||
self._visible = False
|
||||
self.showDialogSignal.connect(self.__show)
|
||||
|
||||
|
@ -45,6 +46,7 @@ class WorkspaceDialog(QObject):
|
|||
self._quality_type = ""
|
||||
self._intent_name = ""
|
||||
self._machine_name = ""
|
||||
self._available_machines = []
|
||||
self._machine_type = ""
|
||||
self._variant_type = ""
|
||||
self._material_labels = []
|
||||
|
@ -63,6 +65,7 @@ class WorkspaceDialog(QObject):
|
|||
qualityTypeChanged = pyqtSignal()
|
||||
intentNameChanged = pyqtSignal()
|
||||
machineNameChanged = pyqtSignal()
|
||||
availableMachinesChanged = pyqtSignal()
|
||||
materialLabelsChanged = pyqtSignal()
|
||||
objectsOnPlateChanged = pyqtSignal()
|
||||
numUserSettingsChanged = pyqtSignal()
|
||||
|
@ -142,6 +145,19 @@ class WorkspaceDialog(QObject):
|
|||
self._machine_name = machine_name
|
||||
self.machineNameChanged.emit()
|
||||
|
||||
@pyqtProperty("QVariantList", notify = availableMachinesChanged)
|
||||
def availableMachines(self):
|
||||
return self._available_machines
|
||||
|
||||
def setAvailableMachines(self, available_machines):
|
||||
if self._available_machines != available_machines:
|
||||
self._available_machines = sorted(available_machines)
|
||||
self.availableMachinesChanged.emit()
|
||||
|
||||
@pyqtProperty(int, notify = availableMachinesChanged)
|
||||
def availableMachinesCount(self):
|
||||
return len(self._available_machines)
|
||||
|
||||
@pyqtProperty(str, notify=qualityTypeChanged)
|
||||
def qualityType(self):
|
||||
return self._quality_type
|
||||
|
@ -229,6 +245,13 @@ class WorkspaceDialog(QObject):
|
|||
if key in self._result:
|
||||
self._result[key] = strategy
|
||||
|
||||
def getMachineToOverride(self):
|
||||
return self._override_machine
|
||||
|
||||
@pyqtSlot(str)
|
||||
def setMachineToOverride(self, machine_name):
|
||||
self._override_machine = machine_name
|
||||
|
||||
@pyqtSlot()
|
||||
def closeBackend(self):
|
||||
"""Close the backend: otherwise one could end up with "Slicing..."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue