mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-07 14:04:03 -06:00
WIP: Add first-start machine actions
This commit is contained in:
parent
d4c0104bc2
commit
8d68db9ff0
16 changed files with 288 additions and 1559 deletions
|
@ -25,10 +25,16 @@ class MachineSettingsManager(QObject):
|
|||
# an extruder's compatible material diameter. This ensures that after the modification, changes can be notified
|
||||
# and updated right away.
|
||||
@pyqtSlot(int)
|
||||
def updateMaterialForDiameter(self, extruder_position: int):
|
||||
def updateMaterialForDiameter(self, extruder_position: int) -> None:
|
||||
# Updates the material container to a material that matches the material diameter set for the printer
|
||||
self._application.getMachineManager().updateMaterialWithVariant(str(extruder_position))
|
||||
|
||||
@pyqtSlot(int)
|
||||
def setMachineExtruderCount(self, extruder_count: int) -> None:
|
||||
# Note: this method was in this class before, but since it's quite generic and other plugins also need it
|
||||
# it was moved to the machine manager instead. Now this method just calls the machine manager.
|
||||
self._application.getMachineManager().setActiveMachineExtruderCount(extruder_count)
|
||||
|
||||
# FIXME(Lipu): Better document what this function does, especially the fuzzy gcode flavor and has_materials logic
|
||||
# regarding UM2 and UM2+
|
||||
# Function for the Machine Settings panel (QML) to update after the usre changes "Number of Extruders".
|
||||
|
@ -37,7 +43,7 @@ class MachineSettingsManager(QObject):
|
|||
machine_manager = self._application.getMachineManager()
|
||||
material_manager = self._application.getMaterialManager()
|
||||
|
||||
global_stack = material_manager.activeMachine
|
||||
global_stack = machine_manager.activeMachine
|
||||
|
||||
definition = global_stack.definition
|
||||
if definition.getProperty("machine_gcode_flavor", "value") != "UltiGCode" or definition.getMetaDataEntry(
|
||||
|
|
|
@ -30,13 +30,6 @@ class WelcomePagesModel(ListModel):
|
|||
def initialize(self) -> None:
|
||||
from cura.CuraApplication import CuraApplication
|
||||
|
||||
self._pages.append({"id": "test",
|
||||
"page_url": QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles,
|
||||
os.path.join("WelcomePages",
|
||||
"TestContent.qml"))),
|
||||
})
|
||||
|
||||
|
||||
# Add default welcome pages
|
||||
self._pages.append({"id": "welcome",
|
||||
"page_url": QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles,
|
||||
|
@ -68,6 +61,11 @@ class WelcomePagesModel(ListModel):
|
|||
os.path.join("WelcomePages",
|
||||
"AddPrinterByIpContent.qml"))),
|
||||
})
|
||||
self._pages.append({"id": "machine_actions",
|
||||
"page_url": QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles,
|
||||
os.path.join("WelcomePages",
|
||||
"FirstStartMachineActionsContent.qml"))),
|
||||
})
|
||||
self._pages.append({"id": "cloud",
|
||||
"page_url": QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles,
|
||||
os.path.join("WelcomePages",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue